Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Form Submission

  1. #1
    New to the CF scene
    Join Date
    Nov 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form Submission

    Okay, so I am still new to some of this. Here is my delimma - I have a form that is completed and the user hits the submit button. Unfortunately when they do this it return to the same form. When I change the coding to go to another url upon submission it does that but it does not submit the form information into my databse. How can I get it to submit the info and then route to another page. The form is at www.bvya.com/survey.php and the page it should route to after the information is submitted to the database is www.bvya.com/survey_end.htm

  • #2
    New Coder
    Join Date
    Aug 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
        $name=$_POST["name"];
        
    $email=$_POST["email"];
        
    $comment=$_POST["comment"];

        
    mysql_query("insert into yourtable (name, email, comment) values('$name','$email','$comment')") or die("Unable to create");
        print 
    "SUCCESS!";
        print 
    "<meta http-equiv='refresh' content='2;url=page.php>"
    The form method is POST and the action is the file your sending the information to. The $name=$_POST["name"]; pulls info from your form... easily done! The Meta tag simply refreshes the browsers into another page after data was input into the database! If you have any further questions, dont be afraid to ask :-)

    -Nate
    Last edited by wallport10; 11-10-2006 at 02:38 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •