Hi

I get the following error

Undefined index: HTTP_HOST in /var/www/vhosts/tauheed-sunnat.com/httpdocs/sunnat/includes/bootstrap.inc on line 241
PHP Notice: Undefined index: HTTP_HOST in /var/www/vhosts/tauheed-sunnat.com/httpdocs/sunnat/includes/bootstrap.inc on line 300
PHP Notice: Undefined index: REMOTE_ADDR in /var/www/vhosts/tauheed-sunnat.com/httpdocs/sunnat/includes/bootstrap.inc on line 1132
PHP Notice: Undefined index: REMOTE_ADDR in /var/www/vhosts/tauheed-sunnat.com/httpdocs/sunnat/includes/bootstrap.inc on line 1132
PHP Parse error: syntax error, unexpected '}' in /var/www/vhosts/tauheed-sunnat.com/httpdocs/sunnat/sites/all/modules/ntest/ntest.module on line 11

My line 11

if($fid>3){ $afid=3; }else {$afid=$fid};

Any idea what the problem is?

Comments

agentrickard’s picture

Most of these are PHP error notices for strict error reporting.

Normally, this feature is turned off, but your host may have it turned on. If you want to write E_ALL compliant code -- and you should -- see http://drupal.org/node/34341

The problem on line 11 is bad code formatting that lets you make (and not see) obvious errors. See http://drupal.org/coding-standards. [The last two characters of your code are reversed.]

--
http://ken.therickards.com

shah_waliuallah’s picture

Thanks i have managed to resolve this.

Any idea how i would change the following code so it displays the resuls by Title (alphabet) and NOT randomly. I got told i would need to remove the n.tid but not sure how i would do that

function updateone_childlisting($parentid = 12){

$js='
$(function(){
alert("Kill me softly...");
});

';
drupal_add_js("misc/jquery.js");

$sql = 'SELECT d.tid as tid,d.name as title, d.description as des, count(n.nid) as coun FROM term_hierarchy h inner join (term_data d, term_node n)on (d.tid=h.tid and n.tid=d.tid) where h.parent='.$parentid.' GROUP BY n.tid order by rand();';

$result = db_query($sql);
for($i=1;$row = db_fetch_array($result);$i++){

$out .= ''
.$row['title'] . '
['.$row['coun'].']

' ;

}
//drupal_add_js($js,"inline");
echo $out;

}
?>