1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: I'm looking for some PHP help

Discussion in 'Web Design & Development' started by tomdkat, Jun 29, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. tomdkat

    tomdkat Trusted Advisor Thread Starter

    Joined:
    May 6, 2006
    Messages:
    7,141
    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...
     
  2. karstudios

    karstudios

    Joined:
    Jun 24, 2011
    Messages:
    75
    Are you trying to create a spam checking function or a mandatory field?
     
  3. tomdkat

    tomdkat Trusted Advisor Thread Starter

    Joined:
    May 6, 2006
    Messages:
    7,141
    Thanks for the reply. Nope, I'm not creating a spam checking function.

    Peace...
     
  4. tomdkat

    tomdkat Trusted Advisor Thread Starter

    Joined:
    May 6, 2006
    Messages:
    7,141
    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! (y)

    Peace...
     
As Seen On
As Seen On...

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.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1004901