I have been looking since yesterday but can't understand why a call to drupal_render() is returning NULL. In my node theme function, when I call drupal_render($element) with $element being defined like below, it renders nothing!
<?php
Array
(
[#type] => textfield
[#title] => Label
[#default_value] =>
[#post] => Array
...
I'm making a little benchmark class to display page load time and memory usage.
Load time is already working, but when I display the memory usage, it doesn't change
Example:
$conns = array();
ob_start();
benchmark::start();
$conns[] = mysql_connect('localhost', 'root', '');
benchmark::stop();
ob_flush();
uses the same memory as
$conn...
Im working in CakePHP now. I'd like to know how i can define a route to a non-cakephp file that doesnt have any controllers associated with it?
I have placed this file(sitemap.php) in webroot folder, for my convenience. Now i need to route to it somehow!
...
Is there a good option for having more than one person developing a Wordpress application with a testing site.
The biggest hurdle that I have encountered are path issues when developing locally and integrating to a testing environment.
Does anyone have a good process for maintaining developer environment(s), keeping working content a...
My friend and I are planning on building a sort of a forum type of webapp.
We've used the major PHP frameworks but we're really thinking about using Python specifically the Pylons framework for our app. Although we're competent PHP programmers, we're somewhat noobs at Python (We could create practical scripts and such). But the thing is ...
I'm currently trying to pull some data from a SQL Server database view that we have restricted access to from our Linux web server.
We don't need to edit the data just display it in a webpage.
It all looks fine until we try to output and only get the first 255 characters of a text field.
Does anyone know if this is a problem with usin...
Below is my code that I am using. I know that the details are correct as they are identical to another page that connects to the database fine. However with this code I get the error:
Access denied for user 'un'@'localhost' (using password: YES). Can anyone tell me what it is i'm doing wrong? Thanks
$hostname = 'localhost';
$username =...
Hello,
I have two tables with list of urls fetched from different sources.
I want to find the common entries and put them in separate table.
This is what I'm doing:
find md5 hash of url while fetching them.
Store them in a column.
I fetch one table as an array, run a loop through it and insert the values from other table where md5...
Hello!
How could I include the count of posts under a category into the a-tag when listing categories. This has been a problem for me many times but now I decided to find out.
<li><a href="#" title="asd">php</a> (1)</li>
to
<li><a href="#" title="asd">php (1)</a></li>
Is you propably assumed, I'm using wp_list_categories to make t...
Hi, how come this isn't working:
$url = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20xpath%3D%22%2F%2Fmeta%22%20and%20url%3D%22http://www.cnn.com%22&format=xml&diagnostics=false";
$xml = (simplexml_load_file($url))
I get multiple errors telling me the HTTP request failed. Ultimately I want to...
When creating a CodeIgniter project, what is the best way to handle relations between models? Should models contain other models that they are related to, should this be handled in the controller, or is there some other way to handle these scenarios? I'm thinking about one-to-one, one-to-many, or many-to-many relationships.
example: let...
Hi, I need to wrap zend form error messages in custom html.
<div class="cerror" id="ID-error">
<div class="ui-widget">
<div class="ui-state-error ui-corner-all" id="IDerror-msg">
%ZEND_FORM_ERROR_MESSAGE%
</div>
</div>
</div>
Now I get errors in format:
<ul>
<li>Error message</li>
</ul>
I nee...
I have this JSON object stored on a plain text file:
{
"MySQL": {
"Server": "(server)",
"Username": "(user)",
"Password": "(pwd)",
"DatabaseName": "(dbname)"
},
"Ftp": {
"Server": "(server)",
"Username": "(user)",
"Password": "(pwd)",
"RootFolder": "(rf)"
}...
In this code :
$path = "C:\NucServ\www\vv\static\arrays\news.php";
$fp = fopen($path, "w");
if(fwrite($fp=fopen($path,"w"),$text))
{
echo "ok";
}
fclose($fp);
I have this error message:
failed to open stream: Invalid argument
What is wrong in my code?
...
Bit of a long shot, but is it possible to count how many emails a given SMTP account has sent in an hour?
Say [email protected] sends emails via Thunderbird and a PHP script.
Can that PHP script first check somehow how many emails have been sent that hour?
Obviously the PHP script can easilly keep a tally of how many emails it sends, ...
I am looking for a simple but secure login script with mySQL PHP: sessions, MD5 that I can use with my exsisting database.
Cookies to store password + password recovery by email.
Change login/pass.
I do not need registering, I register the user myself with temp login/pass.
table agents
agent1
agent2
table albums
album1, owner: age...
Hi,
Can anyone explain to me why the following is resulting in a syntax error (unexpected '=')?
protected function processDates()
{
foreach($this->dates as $name => $unitprefix)
{
$this->$unitprefix.'year' = '';
$this->$unitprefix.'month' = '';
$this->$unitprefix.'day' = '';
...
Is there any way to set a class level variable within a mock object?
I have the mock object set similar to this:
$stub = $this->getMock('SokmeClass', array('method'));
$stub->expects($this->once())
->method('method')
->with($this->equalTo($arg1));
Win the real class there is a variable that needs to be set for it to...
Hi! I have been tearing my hair with this one for a while.
index.php:
$(document).ready(function(){
$(".index_login_subm").click(function(){
uid = $("input:username").val();
pwd = $("input:password").val();
$.post("backend/login.php",{
uid:uid,
pwd:pwd
},function(data){
...
Hi,
I'm just looking for suggestions on the best way to do this...
I need to create a search function that searches for "users" within a 50 mile radius of a zip code. I have a zip code table that contains all the U.S. zip codes with their latitude/longitude but I'm just trying to figure out the best way to structure and query my data....