Jump to content


Photo

undefined error issue


  • Please log in to reply
2 replies to this topic

#1 anthropos9

anthropos9
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 21 April 2006 - 09:03 PM

Hello,

My hosting company just changed servers and ever since then I've been getting this error:
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Notice: Undefined index: id in e:\html\domains\calvaryefc.com\wwwroot\index.php on line 5
Notice: Undefined index: mid in e:\html\domains\calvaryefc.com\wwwroot\index.php on line 6[/quote]
Here is the relavant code to go along with this:

<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...nsitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?php require("includes/connect.php");
$id = $_GET['id'];
$mid = $_GET['mid'];
?>

Any help is welcome. Thanks.

#2 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 21 April 2006 - 09:10 PM

the only thing i'd probably suggest is the error_reporting level in the php configuration is set a bit higher than your old host.

whilst i may get slated for this, it's safe enough to ignore notices. a bit of an addition of a htaccess file or using
ini_set('error_reporting', 2039);
would mean that notices are ignored. they're more 'Good practice' notices rather than anything that's gonna cause you problems, and in your case because the variable(s) you are trying to access ($_GET['whatever']) havent been defined beforehand. if you want to go down the road of perfect practice, look up 'isset' function. [a href=\"http://www.php.net/isset\" target=\"_blank\"]http://www.php.net/isset[/a]

hope that helps a bit
Cheers
Mark
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#3 gizmola

gizmola
  • Administrators
  • Advanced Member
  • 4,667 posts
  • LocationLos Angeles, CA USA

Posted 21 April 2006 - 10:22 PM

[!--quoteo(post=367313:date=Apr 21 2006, 02:03 PM:name=anthropos9)--][div class=\'quotetop\']QUOTE(anthropos9 @ Apr 21 2006, 02:03 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Hello,

My hosting company just changed servers and ever since then I've been getting this error:

Here is the relavant code to go along with this:

<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?php require("includes/connect.php");
$id = $_GET['id'];
$mid = $_GET['mid'];
?>

Any help is welcome. Thanks.
[/quote]

I agree with bullmarky on this one. Those notices aren't errors, but rather warnings. The problem is that you're trying to reference 2 variables that won't exist unless they are passed to the script as url parameters. That may be a perfectly reasonable situation depending on what the script is suppossed to do.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users