Jump to content

!HELP! Undefined Index


code_god

Recommended Posts

Undefined index just means that you are asking for an array key that doesn't exist, or isn't defined.

That should also show up as a notice, and not an error.

 

<?php
{
$name = (isset($_POST['username'])) ? $_POST['username'] : NULL;
$password = (isset($_POST['password'])) ? md5 ($_POST['password']) : NULL;
echo $password;
//if(isset($_POST['notify_box'])){ $notify = $POST['notify_box'];}
}
Link to comment
Share on other sites

No mate it hasn't worked I still have the notice.

 

Here they are:

 

Notice: Undefined index: username in f:\easyphp1-8\www\tim.php on line 9

Notice: Undefined index: password in f:\easyphp1-8\www\tim.php on line 10
d41d8cd98f00b204e9800998ecf8427eMozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 
undefined x 1366

Link to comment
Share on other sites

That doesn't look anything like the code snippet I gave you.  Here it is again.

 

{
$name = (isset($_POST['username'])) ? $_POST['username'] : NULL;
$password = (isset($_POST['password'])) ? md5 ($_POST['password']) : NULL;
echo $password;
//if(isset($_POST['notify_box'])){ $notify = $POST['notify_box'];}
}
Link to comment
Share on other sites

well your issue stands in the area

echo "<br>";

if(!isset($_GET['r']))
{
	echo "<script language=\"javascript\">
	<!--
	document.location=\"$PHP_SELF?r=1&width=\"+screen.width+\"&Height=\"+screen.Height;
	//-->
	</script>";
}
else
{

	//CODE TO BE DISPLAYED IF RESOLUTION IS DETECTED
	if(isset($_GET['width']) && isset($_GET['Height']))
	{
		echo $_GET['Height']." x ". $_GET['width'];
	}
	else
	{
		echo "resolution not detected";
	}

}
?>

where are you defining "r" 

Link to comment
Share on other sites

Here is your script running on my server: with the suggested fix.

	Name : 
	Password : 
	 
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.22+ (KHTML, like Gecko) Chromium/17.0.963.56 Chrome/17.0.963.56 Safari/535.22+ 
undefined x 1920

PS, the issue in this case isn't $_GET['r'] because OP is already testing if it is set.

Edited by jcbones
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.