Recently I updated from Xampp 1.7.3 to 1.7.4, when I go into a login page on my site (written in PHP) i get an error message "Notice: Undefined index: submitbutt in C:\xampp\htdocs\bazaar\login.php on line 22" this message is in the Begin Body Content area of the code when it displays on the page.
If I enter a user name that is in my database, it allows me to log in, but i then get 2 error message appearing at the top of the Begin Header, messages read:
1"Notice: Use of undefined constant myusername - assumed 'myusername' in C:\xampp\htdocs\bazaar\purchase.php on line 4"
And
2"Deprecated: Function session_is_registered() is deprecated in C:\xampp\htdocs\bazaar\purchase.php on line 4"
Until I updated Xampp, I had none of these code errors. Can someone help out please?
The codes for the login page is:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Login</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="javascript/date.js"></script>
<script language="JavaScript" type="text/javascript"></script>
</head>
<body>
<div id="wrapper">
<!--Begin Header-->
<?php
include ("header.php");
?>
<!--End Header-->
<div>
<!--Begin Body Content-->
<div id="bcell_1_1">.: Login :.</div>
<div id="bcell_1_2">Existing Member<br />
<?php
if($_POST['submitbutt']) {
echo "myusername: ". $_POST['UserName'] ."<br />";
echo "mypassword: ". $_POST['Password'] ."<br />";
}
else {
?>
<form name="form1" method="post" action="checklogin.php">
<p>User Name:<br>
<input name="UserName" type="text" id="UserName">
<p>Password:<br />
<input name="Password" type="password" id="Password">
<p>
<input type="submit" name="login" value="Login" />
</form>
<?php
}
?>
</div>
<!--End Body Content-->
</div>
<div>
<!--Begin Footer Content-->
<?php
include ("footer.php");
?>
<!--End Footer Content-->
</div>
</div>
</div>
</body>
</html>
And the code for the purchase page is as follows:
<?php // Check if session is not registered , redirect back to main page.
// Put this code in first line of web page.
session_start();
if(!session_is_registered(myusername))
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Purchase</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="javascript/date.js"></script>
<script language="JavaScript" type="text/javascript"></script>
</head>
<body>
<div id="wrapper">
<!--Begin Header-->
<?php
include ("headerli.php");
?>
<!--End Header-->
<div>
<!--Begin Body Content-->
<div id="bcell_1_1">.: Purchase :. Welcome, <?php echo $_SESSION["UserName"]?>, you are now logged in!</div>
<div id="bcell_1_2">To make a purchase simly click the "add to cart" button and then select the "purchase" button when you have completed your shopping</div>
<!--End Body Content-->
</div>
<div>
<!--Begin Footer Content-->
<?php
include ("footer.php");
?>
<!--End Footer Content-->
</div>
</body>
</html>