Security Issue, help please!
Posted by: johnson (---.bb.sky.com)
Date: April 24, 2011 10:44AM

Hi Folks, below are the codes I tried to use to authenticate my database but after logging in, I get this error massage
"Notice: Undefined index: PHP_SERVER in C:\wamp\www\menu.php on line 43 Call Stack #TimeMemoryFunctionLocation 10.0011371504{main}( )..\menu.php:0 ?logout=1">Log Out
"

Can someone help please cos I am newbie




if (isset($_POST['username']))
{
//check credentials
if ($_POST['username'] == '*******' and
$_POST['password'] == '********')
{
$_SESSION['authorized'] = TRUE;
}
}

//process logout
if (isset($_REQUEST['logout']))
{
unset($_SESSION['authorized']);
}

//check login
if (isset($_SESSION['authorized']))
{
//display secure information
?>
some html info are displayed here

line 43 <p><a href="<?php echo $_SERVER['PHP_SERVER']; ?>?logout=1">Log Out</a></p>
<?php
}
else
{
//display login form
?>
<h2>Please log in for access</h2>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table>
<tr><td>User name:</td> <td><input type="text" name="username" ></td></tr>
<tr><td>Password:</td> <td><input type="password" name="password" ></td></tr>
<tr ><td><input type="submit" value="Log In"></td></tr>
</table>
</form>
<?php
}
?>

Options: ReplyQuote
Re: Security Issue, help please!
Posted by: stevenmartin99 (---.b-ras1.srl.dublin.eircom.net)
Date: April 24, 2011 11:10AM

its not an error. its a notice for bad coding.

turn off notices in the php.ini or fix the coding error.

Please dont ask for coding help here. - your error is common - its all over the web.

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote


Sorry, only registered users may post in this forum.