Jump to content

Archived

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

anthropos9

undefined error issue

Recommended Posts

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/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.

Share this post


Link to post
Share on other sites
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 [code]ini_set('error_reporting', 2039);[/code] 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

Share this post


Link to post
Share on other sites
[!--quoteo(post=367313:date=Apr 21 2006, 02:03 PM:name=anthropos9)--][div class=\'quotetop\']QUOTE(anthropos9 @ Apr 21 2006, 02:03 PM) [snapback]367313[/snapback][/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.

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.