Jump to content

Archived

This topic is now archived and is closed to further replies.

thebeing

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

Recommended Posts

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

the problem :
i get this error...

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


for this code...


[quote] <?=$showCategories?>[/quote]


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

thnx in advance!

Share this post


Link to post
Share on other sites
$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

Share this post


Link to post
Share on other sites
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... :(

Share this post


Link to post
Share on other sites
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';

Share this post


Link to post
Share on other sites
i did as you said...

from [code] <?=$showCategories?>[/code] i made [code] <? $showcategories='showcategory.php' ?> [/code] ...but, in showcategory.php i have these errors :
[code] 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[/code]

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

it also gives the same errors for the connect.php, which is the... connect config file...
two errors 1. [code][b]Notice: Undefined variable: categories in c:\program files\easyphp1-8\www\e_site\conn.php on line 42[/b][/code]
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 :
[code]
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'])[/code]

...can you still guide me? please?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.