heyya..
can anyone help me here..
i got a problem with my edit form
my code as follow:
<?
require 'f:/www/digitallibrary/conf/config.inc.php';
require 'f:/www/digitallibrary/conf/smarty.inc.php';
chdir('../../');
?>
<?php
$query = "select * from dil_logins WHERE userID='".$_GET['userID']."'";
$result = mysql_query($query);
if (!$result)
{
die('DIEEEEEEEE'.mysql_error());
}
echo "HEY : ".$query;
$row = mysql_fetch_array($result);
$userID=$row["userID"];
$username=$row["username"];
$password=$row["password"];
?>
<html>
<head>
<title>student form</title>
</head>
<body>
<form action="edit_form.php" method="post">
<fieldset style="width: 320; height: 240; padding: 2">
<p><b>Username: </b>
Username <input type="text" name="userID" readonly size="20" maxlength="40" value='<?php echo $userID;?>'></p>
<p><b>First Name: </b>
First_Name <input type="text" name="username" size="20" maxlength="40" value='<?php echo $username;?>' ></p>
<p><b>Last Name: </b>
Second_Name <input type="text" name="password" size="20" maxlength="40" value='<?php echo $password;?>'></p>
<input type ="submit" value="Edit "></form>
</fieldset>
</body>
</html>
<?php
if (isset($_POST["userID"]))
{
//$query = "select * from STUDENT WHERE email='$email'";
//$result = mysql_query($query);
$query_insert = "update dil_logins set username='".$_POST['username']."',password='".$_POST['password']."' where userID='".$_POST['UserID']."'";
echo "HEY 2 :".$query_insert;
$execute_query = mysql_query($query_insert);
if (!$execute_query)
{
die('DIEEEEEEEE'.mysql_error());
}
else
{
echo "Succeessful insert";
}
}
?>
<p>
<a href ="menu.html">Back</a></p>
the error apear to be like this;
Notice: Undefined index: userID in F:\WWW\digitallibrary\htdocs\login\edit_form.php on line 8
i have no idea where should i define the username..
please help me out...
thanks in advanced