Advanced Search

Results 1 to 3 of 3

Thread: sending form data to another page

  1. #1
    Join Date
    Nov 2010
    Posts
    114
    Thanks
    27
    Thanked 0 Times in 0 Posts

    Default sending form data to another page

    Hi All,

    I want to know how to send the form data into another page without using any appending id like nextpage.php?id=1&name=name&..............

    Suppose i am having my registration page where iam filling all the user data. when i press submit it should not submit those values in database in this page it should directly goto another page and should save the values in database in that page. Is it possible?

  2. #2
    Join Date
    Jan 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    There are a few ways of doing this.

    You can use method post instead of get, it still sends it through the header but not the url. You can also set a cookie or a server variable to keep a state, though generally you would want to use method='get' or method='post' to do this.

    Hope this helped.

  3. #3
    Join Date
    Dec 2010
    Location
    Hyderabad, India
    Posts
    16
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    mchale is spot on.

    Code:
    <form name="myform" method="post" action="script.php">
    
    </form>
    
    
    PHP code
    
    <?php
    extract($_POST);
    ?>
    When you run that function all your form input elements` names will be turned into variables. For example you used name "username" for <input> tag it will converted to $username for you to work around with it in your script page.

Bookmarks

Posting Permissions

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