![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Man Bear Pig Hunter
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4
![]() |
ASP Guy on PHP
Hey I need to help a friend of mine out with his website and it keeps giving me these errors saying
"Notice: Undefined variable: pg in D:\Websites\www.website.com\index2.php on line 44" Days that for every line from 44 to 51, here are those lines. [PHP] <?PHP LINE 44 if ($pg != "field" && $pg != "forums" && $pg != "add_discussion" && $pg != "entry" && $pg != "add_reply" && $pg != "schedule" && $pg != "leaguestats" && $pg != "dbeditor") { include ("edit/right_column.php"); } ?>[/PHP] Also it is saying "Notice: Undefined index: pg in D:\Websites\www.website.com\index2.php on line 33" Line 33's PHP reads this [PHP] <?php LINE 33:if ($_GET["pg"] != "") { include ("edit/".$_GET["pg"].".php"); } else { include ("edit/main.php"); } ?>[/PHP] Thanks a lot you PHP guys.
__________________
People who click "images" that end with .exe shouldn't have computers. |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Uh, well, the first message is telling you that $pg hasn't previously been assigned a value. The second message is telling you that there is no 'pg' variable specified in the URL (e.g. "test.php?pg=foobar").
Without seeing more of the source, I can't give any further information. |
|
|
|
|
|
#3 |
|
Man Bear Pig Hunter
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4
![]() |
The problem is that the homepage uses params to capture the content and if there is no param then it has an error finding the value of the $_GET["pg"]
Fixed the $pg for him thou. Thanks.
__________________
People who click "images" that end with .exe shouldn't have computers. |
|
|
|
|
|
#4 |
|
Man Bear Pig Hunter
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4
![]() |
Just did a quick fix for it, thanks for your help.
__________________
People who click "images" that end with .exe shouldn't have computers. |
|
|
|
|
|
#5 |
|
Hobbyist Programmer
|
if(isset($_GET['pg'])){ //blah
__________________
#programmingforums relay - http://thegupstudio.com/cgi-bin/pforelay.cgi freelance scripts - http://ryanguthrie.com/index.html |
|
|
|
|
|
#6 |
|
Man Bear Pig Hunter
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4
![]() |
Perfect, thanks.
__________________
People who click "images" that end with .exe shouldn't have computers. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|