Jump to content


Photo

code problem..please help. i'm a newbie! :)


  • Please log in to reply
4 replies to this topic

#1 thebeing

thebeing
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 29 September 2006 - 12:52 PM

Hello! i'm having some problem with some php code...

the problem :
i get this error...

Notice: Undefined variable: showCategories in c:\program files\easyphp1-8\www\joke_site\templates\MainHeader.php on line 86


for this code...


<?=$showCategories?>



can anyone help me, please? can anyone tell me, what must i write in the code to make it work?

thnx in advance!


#2 steveclondon

steveclondon
  • Members
  • PipPipPip
  • Advanced Member
  • 161 posts

Posted 29 September 2006 - 12:58 PM

$showCategories has no value. You must first set a value for this as follows.

$showCategories='it will now be this message';

echo $showCategories;

If this is part of a bigger script you have you might want to put it up here as i would imagine there is another problem there higher up

#3 thebeing

thebeing
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 29 September 2006 - 01:08 PM

hello, and thnx for your reply...

i thought of inserting a bigger part of the code into my post...but most of it would have been irrelevand...

however...if ur willing to help me (please, be!), here's a bigger part of the code...

http://tinyurl.com/ewcrq

note : the memberblock thinggie works... but the categories and the buttonbanner don't...

this is a part from a script i bought from someone over the net...and now he(or she...) doesn't answe when i try to contact him/her... :(

#4 steveclondon

steveclondon
  • Members
  • PipPipPip
  • Advanced Member
  • 161 posts

Posted 29 September 2006 - 01:11 PM

thats just a main header that shows the information from the php script. You should have code that goes above that. If you have a file named index.php have a look at that and see all the files listed in that

you might have for example. include 'top.php';

#5 thebeing

thebeing
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 29 September 2006 - 02:39 PM

i did as you said...

from
<?=$showCategories?>
i made
<? $showcategories='showcategory.php' ?>
...but, in showcategory.php i have these errors :
Notice: Undefined index: CategoryID in c:\program files\easyphp1-8\www\e_site\showcategory.php on line 6

Notice: Undefined index: CategoryID in c:\program files\easyphp1-8\www\e_site\showcategory.php on line 12

This is how line 6 and 12 look in the php :
line 6
$q1 = "select CategoryName from dd_categories where CategoryID = '$_GET[CategoryID]'  ";
line 12
$MainQuery = "select * from dd_items where ItemCategory = '$_GET[CategoryID]' and ItemStatus = 'approved' ";

it also gives the same errors for the connect.php, which is the... connect config file...
two errors 1.
[b]Notice: Undefined variable: categories in c:\program files\easyphp1-8\www\e_site\conn.php on line 42[/b]
and the 2. Notice: Undefined index: CategoryID in c:\program files\easyphp1-8\www\joke_site\conn.php on line 44...the code in the connect php is :
line 42    $categories .= "<a class=CatLinks href=\"ShowCategory.php?CategoryID=$ac[CategoryID]\">$ac[CategoryName] ($ain[0])</a><br>\n\t\t\t";

line 44	   if($_GET['CategoryID'] == $ac['CategoryID'])

...can you still guide me? please?





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users