| Trusted Advisor with 7,024 posts. THREAD STARTER | | Join Date: May 2006 Location: S.F. Bay Area, CA Experience: Intermediate | |
Solved: I'm looking for some PHP help Ok, I'm working on a PHP script that will take some data from a HTML form and process it on the server. The issue is error reporting. If the user enters an incorrect id, for example, I would want to report that error to the user BUT do so on the same page on which they entered the id.
Here is a simple HTML test case: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>PHP test case</title>
</head>
<body>
<form method="post" action="script.php" name="test">
Enter ID: <input size="10" name="id"><br>
<input name="submit" value="Send now" type="submit">
</form>
<br>
Error appears here
</body>
</html> So, the user enters an id in the box and clicks "Send now". If the server-side script detected a problem, an error would be returned where the "Error appears here" text currently is.
Any ideas on how to accomplish this?
Thanks!
Peace... |