Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 8 of 8
  1. #1
    Senior Member ericbusch's Avatar
    Join Date
    Aug 2003
    Location
    Daejeon, South Korea
    Posts
    241
    Member #
    2779
    I am struggling here to access the data a user submits on a form.

    i have no problem writing the html code, but after that i am stabbing in the dark. what do i need to do on the server end? what other pages do i need to make to help process the data? how do i access the data once the user submits it?

    From these questions i'm sure you know my skill level at this. I feel very comfortable with html, but after that things get a little shaky.

    Thanks for any help you can give me!

    Eric Busch
    www.ericbusch.net
    Blogs For Sale - Each blog is packed with 1000s of signatures and ads are highly integrated into the site. Great CTR! Completely customizable from Admin CP. On Sale!
    Complete Websites For Sale - Fantastic looking sites rich with content. Come complete with domain names. I only have a couple of these.

  2.  

  3. #2
    Member Borior's Avatar
    Join Date
    Jul 2003
    Posts
    30
    Member #
    2253
    ok .. so your html is gonna look something like this:

    Code:
    <html>
    <head>
    <title>My Form</title>
    </head>
    <body>
    <form method="get" action="processform.php">
    <input type="text" name="firstname" value="Your First Name" />
    <input type="text" name="lastname" value="Your Last Name" />
    </form>
    </body>
    </html>
    Now let's just say, very simply you want to print back the first and last name onto the screen.

    Your PHP (processform.php) should look something like this:

    PHP Code:
    <html>
    <head>
    <title>Form Output</title>
    </head>
    <body>

    <?php
        
    print "<strong>First Name:</strong>";
        echo 
    $_REQUEST['firstname'];
        print 
    "<br /><strong>Last Name:</strong>";
        echo 
    $_REQUEST['lastname'];
    ?>
    </body>
    </html>
    Hope this helps you with your first tentative steps in the world of PHP form handling

  4. #3
    Senior Member ericbusch's Avatar
    Join Date
    Aug 2003
    Location
    Daejeon, South Korea
    Posts
    241
    Member #
    2779
    close...

    thanks for all the code!

    i copied and pasted it and made some new pages. i'm getting closer. there was no error message, but the returned webpage was completely blank. in the location bar this appears:

    http://ericbusch.net/processform.php...lastname=busch
    (eric being my first name and busch being my last)

    the initial page is my_form if you want to check it out.

    anyway, my main goal is to build a simple page where i can use a form to test some of my students. the form certainly does not need to be secure, i just need to access the data they submit. it seems so simple, though its proving to be a real stumper. i have tried setting the ACTION to send me an email with the results, though that is not working either. (i'm on a mac using IE5 if that makes any difference.)

    Any suggestions?
    Thanks, Eric Busch
    Blogs For Sale - Each blog is packed with 1000s of signatures and ads are highly integrated into the site. Great CTR! Completely customizable from Admin CP. On Sale!
    Complete Websites For Sale - Fantastic looking sites rich with content. Come complete with domain names. I only have a couple of these.

  5. #4
    Member Borior's Avatar
    Join Date
    Jul 2003
    Posts
    30
    Member #
    2253
    sorry ... you need an <input type="submit" value="submit" /> just before the </form> tag .... however the fact that the page is blank is very odd ... are you sure that you have php installed on your webserver. try creating a file called phpinfo.php which contains:
    PHP Code:
    <?php
    phpinfo
    ();
    ?>
    That should output loads of stuff about the version etc of php installed on your server. If it doesn't, then something is very wrong.

  6. #5
    Senior Member ericbusch's Avatar
    Join Date
    Aug 2003
    Location
    Daejeon, South Korea
    Posts
    241
    Member #
    2779
    PHP is on the server...

    i installed PHP on the server and then made the phpinfo page and it gave me a ton of info about itself.

    but what can i do with all that?

    i then checked my my_form page again and still nothing happens when i enter in the text fields. i just get a blank page with the same text as before in the location bar.

    now that i have the Php installed, is there some page i can make where the user data can be sent?

    Thanks for your help!!
    eric
    Blogs For Sale - Each blog is packed with 1000s of signatures and ads are highly integrated into the site. Great CTR! Completely customizable from Admin CP. On Sale!
    Complete Websites For Sale - Fantastic looking sites rich with content. Come complete with domain names. I only have a couple of these.

  7. #6
    Senior Member skrlin's Avatar
    Join Date
    Apr 2003
    Location
    Illinois
    Posts
    562
    Member #
    1063
    Try the example I have on my server.
    http://www.skrlin.com/Testing/php/form.htm

    All you need is that submit button. The php and html are all the same except for the added submit button.

    Try it out and see what you think.
    - Brian

  8. #7
    Senior Member ericbusch's Avatar
    Join Date
    Aug 2003
    Location
    Daejeon, South Korea
    Posts
    241
    Member #
    2779
    That works! next question...

    i am finally able to produce that.

    Now, is it possible for those results to be sent to me via email or viewed in another file? I just want to be able to gather data from the user.

    Thanks for all your help!
    eric
    Blogs For Sale - Each blog is packed with 1000s of signatures and ads are highly integrated into the site. Great CTR! Completely customizable from Admin CP. On Sale!
    Complete Websites For Sale - Fantastic looking sites rich with content. Come complete with domain names. I only have a couple of these.

  9. #8
    Senior Member ericbusch's Avatar
    Join Date
    Aug 2003
    Location
    Daejeon, South Korea
    Posts
    241
    Member #
    2779
    I got it!

    Thanks for everyones input.

    i think i've got it figured out, in the loosest sense of the word that is.

    anyway, i had to install the Mail Form on my webserver, what ever that means. thanks for the tip-off on that.

    anyway, it worked!

    eric
    (i love when things work!)
    Blogs For Sale - Each blog is packed with 1000s of signatures and ads are highly integrated into the site. Great CTR! Completely customizable from Admin CP. On Sale!
    Complete Websites For Sale - Fantastic looking sites rich with content. Come complete with domain names. I only have a couple of these.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:45 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com