PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
if (isset($_POST['submit']))
{
$message = NULL;
//check for project title
if (empty($_POST['projecttitle']))
{
$pt = false;
$message .= 'You forgot to enter the project title<br>';
}
else
{
$pt = $_POST['projecttitle'];
}
if ($pt)
{
//sql code goes here
}
}
if (isset($message))
{
echo '<font color=red>'.$message.'</font>';
}
the result of this is when the user supplied a blank character in the textbox, the error message will appear above the form, right?now, the deal is that, i want the error message to appear right after the textbox...can u guys help me modify the above code so i can attain this idea?thanks in advance..
Last edited by pleigh on Mon Aug 29, 2005 5:32 am, edited 1 time in total.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
if (isset($_POST['submit']))
{
$error = array();
//check for project title
if (empty($_POST['projecttitle']))
{
$pt = false;
$error['projecttitle'] = 'You forgot to enter the project title<br>'; //set the projecttitle error...
}
else
{
$pt = $_POST['projecttitle'];
}
if ($pt)
{
//sql code goes here
}
}