Hi there, I have a little html form in a page called "yourbirthday.html" (including username and password). Then in this form I use "insert_bd.php" to handle the info.
<form action="insert_bd.php" method="post" />
<table style="padding:125px 10px 10px 10px; color:white; width: 240px;" border="0" align="center">
<tr>
<td>Username</td>
<td><input type="text" name="username" maxlength="30" size="13" value="username" /></td>
</tr>
<tr>
<td style="color:white;">Password</td>
<td><input type="password" name="password" maxlength="30" size="13" /></td>
</tr>
Since in my insert_bd.php I have only code if you dont input a username or a password a message will be echo telling you that there is something missing, but I dont want that message to be echoed in insert_bd.php but in yourbirthday.html where the form is nested and the user can know what is missing a change it.
This is the code in insert_bd.php, I wrote this code which is not doing what I want but it can illustrate it.
$myusername=$_POST['username'];
$mypassword=$_POST['password'];
if(empty($_POST['username']))
{
header("location: http://myweb.com/yourbirthday.html");
$error = 'No username'; // I need this print or echoed in yourbirthday.html
exit;
}elseif(empty($_POST['password'])){
header("location: http://myweb.com/yourbirthday.html");
$error = 'No Password'; // I need this print or echoed in yourbirthday.html
exit;
}
How can I do this or what is the commo practice on something like this?
Thanks for any information or approach on this one.
Greetings.