I've got a error message from my xampp server saying that :
Notice: Undefined index: u_name in C:\xampp\htdocs\kownload\path\admin-rgst.php on line 5
Notice: Undefined index: u_pwd in C:\xampp\htdocs\kownload\path\admin-rgst.php on line 6
Notice: Undefined index: u_email in C:\xampp\htdocs\kownload\path\admin-rgst.php on line 7
My php code :
<?php
include 'header.php';
?>
<?php
$u_name = strip_tags($_POST['u_name']);
$u_pwd = md5($_POST['u_pwd']);
$u_email = strip_tags($_POST['u_email']);
if(isset($_POST['rgstdo'])){
if(!empty($u_name) or !empty($u_pwd) or !empty($u_email)){
echo "<h1>Error</h1>";
}
}
?>
My html :
<form action="admin-rgst.php" method="post">
<table>
<tr>
<td><input type="text" name="u_name" placeholder="username"></td>
</tr>
<tr>
<td><input type="password" name="u_pwd" placeholder="pwd"></td>
</tr>
<tr>
<td><input type="email" name="u_email" placeholder="email"></td>
</tr>
<tr><td><input type="submit" name="rgstdo" value="submit"></td></tr>
</table>
</form>
again php
<?
include 'footer.php';
?>
The form is working (showing) and the empty error message also working but i have these messages in the header. What is the problem and the solution please ?