Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Web Design & Development Web Design & Development
Search Search
Search for:
Tech Support Guy > > >

Solved: I'm looking for some PHP help


(!)

tomdkat's Avatar
Computer Specs
Trusted Advisor with 7,141 posts.
THREAD STARTER
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
29-Jun-2011, 05:43 PM #1
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:&nbsp; <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...
karstudios's Avatar
karstudios karstudios is offline
Computer Specs
Member with 75 posts.
 
Join Date: Jun 2011
Location: USA
Experience: Einstein
29-Jun-2011, 05:52 PM #2
Are you trying to create a spam checking function or a mandatory field?
tomdkat's Avatar
Computer Specs
Trusted Advisor with 7,141 posts.
THREAD STARTER
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
29-Jun-2011, 05:52 PM #3
Thanks for the reply. Nope, I'm not creating a spam checking function.

Peace...
tomdkat's Avatar
Computer Specs
Trusted Advisor with 7,141 posts.
THREAD STARTER
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
29-Jun-2011, 07:34 PM #4
Thanks to karstudios, this issue is solved! He steered me to this page which made the solution almost trivial. Make the HTML form a PHP script and I can do all the error processing I need easily!

Thanks again karstudios!

Peace...
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


Tags
php

(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑