Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 30th, 2005, 12:04 PM   #1
Ghost
Man Bear Pig Hunter
 
Ghost's Avatar
 
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4 Ghost is on a distinguished road
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.
Ghost is offline   Reply With Quote
Old Dec 30th, 2005, 12:35 PM   #2
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
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.
Arevos is offline   Reply With Quote
Old Dec 30th, 2005, 12:41 PM   #3
Ghost
Man Bear Pig Hunter
 
Ghost's Avatar
 
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4 Ghost is on a distinguished road
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.
Ghost is offline   Reply With Quote
Old Dec 30th, 2005, 12:50 PM   #4
Ghost
Man Bear Pig Hunter
 
Ghost's Avatar
 
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4 Ghost is on a distinguished road
Just did a quick fix for it, thanks for your help.
__________________
People who click "images" that end with .exe shouldn't have computers.
Ghost is offline   Reply With Quote
Old Dec 30th, 2005, 3:38 PM   #5
Mocker
Hobbyist Programmer
 
Mocker's Avatar
 
Join Date: Oct 2005
Location: Indiana
Posts: 218
Rep Power: 0 Mocker is an unknown quantity at this point
Send a message via AIM to Mocker
if(isset($_GET['pg'])){ //blah
__________________
#programmingforums relay - http://thegupstudio.com/cgi-bin/pforelay.cgi
freelance scripts - http://ryanguthrie.com/index.html
Mocker is offline   Reply With Quote
Old Jan 2nd, 2006, 4:05 AM   #6
Ghost
Man Bear Pig Hunter
 
Ghost's Avatar
 
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4 Ghost is on a distinguished road
Perfect, thanks.
__________________
People who click "images" that end with .exe shouldn't have computers.
Ghost is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:12 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC