note 89983 added to function.session-start
| From: | tomanne10 at yahoo dot com dot ph | Date: | Wed, 01 Apr 2009 00:50:18 +0000 |
| Subject: | note 89983 added to function.session-start | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-152673@lists.php.net to get a copy of this message | ||
Please recheck the code, so that it will not automatically get the value from form without even
adding value for each input object please help me. Thanks.
<html>
<head><title>Updating Password</title>
</head>
<body bgcolor="FFCC99">
<form name="form1" method="POST">
<center>
<B><font size=3>PASSWORD UPDATE</font></B><BR><BR>
<table>
<tr><td>
<B>Username:</B></td><td><input DISABLED= "TRUE"
type="text" name="userid" size=15 maxlength=6 value=<?php
if (isset($_REQUEST['userid'])) {
echo $_REQUEST['userid'];
}
?>></td></tr>
<tr><td>
<B>Enter New Password:</B></td><td><input type="password"
name="newpassword" size=15 maxlength=15 ></td></tr>
<tr><td>
<B>Re- Enter New Password:</B></td><td><input type="password"
name="confirmpassword" size=15 maxlength=15></td></tr>
<tr><td colspan=2 align="center"><BR>
<input type="submit" value="OK"></td></tr>
</table>
</center>
</form></body>
<?php
$userid = $_POST['userid'];
$confirmpassword = $_POST['confirmpassword'];
$newpassword = $_POST['newpassword'];
// Make a MySQL Connection
$mysql_connect = mysql_connect("localhost","anne","annezai") or
die(mysql_error());
mysql_select_db("sample") or die(mysql_error());
//New Password and Confirm Password Mismatch
if ( $newpassword <> $confirmpassword)
{echo "<script>alert('New and Confirmation Password
Mismatch')</script>"; }
else if (strlen($newpassword) < 15 and strlen($confirmpassword) > 8)
{
$confirmpassword = substr(crypt($confirmpassword),0,10);
$update_query = "UPDATE
sampltb SET password =
'$confirmpassword'
WHERE sampltb.id = '$userid'";
mysql_query($update_query) or die(mysql_error());}
else
{echo "<script>alert('Password must at least 8 to 15 characters
length')</script>"; }
?>
</html>
----
Server IP: 69.147.83.197
Probable Submitter: 58.71.23.99
----
Manual Page -- http://www.php.net/manual/en/function.session-start.php
Edit -- https://master.php.net/note/edit/89983
Del: integrated -- https://master.php.net/note/delete/89983/integrated
Del: useless -- https://master.php.net/note/delete/89983/useless
Del: bad code -- https://master.php.net/note/delete/89983/bad+code
Del: spam -- https://master.php.net/note/delete/89983/spam
Del: non-english -- https://master.php.net/note/delete/89983/non-english
Del: in docs -- https://master.php.net/note/delete/89983/in+docs
Del: other reasons-- https://master.php.net/note/delete/89983
Reject -- https://master.php.net/note/reject/89983
Search -- https://master.php.net/manage/user-notes.php