I have created a login form using php and html in which if i give the wrong user and password it shows error. There is also a signup link to create a new user and password. If the user and password are correct, it will be redirected to a form page which has name, work area, mobile, Email, Comments.
If user enter the details and click submit, data will be added to database and a page will be displayed with the data entered.
Now, i need to edit the data that is shown in the last page. And the data page that is shown must have all the details entered in that id.
Thanks in advance![This is the form image and the php coding that work on page generation![
<?php
$connect=mysql_connect("localhost","root","user");
if(!$connect)
{
die('Could not connect: ' .mysql_error());
}
mysql_select_db("form",$connect);
$name=$_POST["name"];
$email=$_POST["email"];
$number=$_POST["number"];
$org=$_POST["org"];
$message=$_POST["message"];
$sql="INSERT INTO cath values('$name','$email','$number','$org','$message')";
if(!mysql_query($sql,$connect))
{
die('error:'.mysql_error());
}
echo "One record added";
mysql_close($connect);
?>
<?php
echo "<br>";
$connect=mysql_connect("localhost","root","user");
mysql_selectdb("form");
$result=mysql_query("SELECT * FROM cath");
echo "The details are....";
while($rows=mysql_fetch_array($result))
{
echo "<br>";
echo $name;
echo "<br>";
echo $email;
echo "<br>";
echo $number;
echo "<br>";
echo $org;
echo "<br>";
echo $message;
}
?>]