Hi everyone,
Please check php code below, when i load this page in browser it gives me following errors.
"Notice: Undefined index: submit in E:\wamp\www\login\register.php on line 4"
"Notice: Undefined index: fullname in E:\wamp\www\login\register.php on line 5"
"Notice: Undefined index: username in E:\wamp\www\login\register.php on line 6
"Notice: Undefined index: password in E:\wamp\www\login\register.php on line 7"
"Notice: Undefined index: repeatpassword in E:\wamp\www\login\register.php on line 8"
I want that when i submit the form it echo back fullname, username etc. I will highly appreciate who solves my problem.
<?php
echo "<h1>Register</h>";
$submit = $_POST['submit'];
$fullname = $_POST['fullname'];
$username = $_POST['username'];
$password = $_POST['password'];
$repeatpassword = $_POST['repeatpassword'];
if($submit)
{
echo"$submit, $fullname, $username, $password, $repeatpassword";
}
?>
<html>
<form action="register.php" method="POST">
<table>
<tr>
<td>Full name : </td>
<td>
<input type="text" name="fullname" />
</td>
</tr>
<tr>
<td>Username : </td>
<td>
<input type="text" name="username" />
</td>
</tr>
<tr>
<td>Password : </td>
<td>
<input type="password" name="password" />
</td>
</tr>
<tr>
<td>Re-type Password : </td>
<td>
<input type="password" name="repeatpassword" />
</td>
</tr>
<tr>
<td>
<input type="submit" name="submit" value="Register" />
</td>
</tr>
</table>
</form>
</html>