anthropos9 Posted April 21, 2006 Share Posted April 21, 2006 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 5Notice: 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. Quote Link to comment https://forums.phpfreaks.com/topic/8080-undefined-error-issue/ Share on other sites More sharing options...
redbullmarky Posted April 21, 2006 Share Posted April 21, 2006 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 bitCheersMark Quote Link to comment https://forums.phpfreaks.com/topic/8080-undefined-error-issue/#findComment-29455 Share on other sites More sharing options...
gizmola Posted April 21, 2006 Share Posted April 21, 2006 [!--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. Quote Link to comment https://forums.phpfreaks.com/topic/8080-undefined-error-issue/#findComment-29479 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.