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 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2009
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Post Php Resend form data

    i would like to without using curl resend form data so for example the page with the form:

    <form action="formaction.php" method="post">
    Enter The Question: <input type="text" name="question" />
    <input type="submit" />
    </form>

    then submit that to formaction.php then in formaction.php how do i resend that posted data to another page like formmail.php
    so on formaction.php it would check captcha from the form then resubmit other posted data to formmail.php

    how would i do this?

  • #2
    New Coder
    Join Date
    Jul 2008
    Posts
    24
    Thanks
    3
    Thanked 1 Time in 1 Post
    I can think of two options:
    - store the results of the formaction.php form in the session, and then redirect the user to formmail.php. Then get the results out of the session. Something like this:
    PHP Code:
    session_start(); 
    $_SESSION['form_results'] = $_POST;
    header("Location: formmail.php"); 
    And then in formmail.php:
    PHP Code:
    session_start(); 
    $question $_SESSION['form_results']['question']; 

    - Or, redirect the user to formmail.php and tag a bunch of $_GET variables on the request. Something like this:
    PHP Code:
    if(count($_POST) > 0)
        
    $q_string '?'.http_build_query($_POST);
    header(sprintf("Location: formmail.php%s"$q_string)); 
    And then in formmail.php:
    PHP Code:
    $question $_GET['question']; 

  • #3
    New Coder
    Join Date
    Mar 2009
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Post Formmail.php

    Quote Originally Posted by mdg583 View Post
    I can think of two options:
    - store the results of the formaction.php form in the session, and then redirect the user to formmail.php. Then get the results out of the session. Something like this:
    PHP Code:
    session_start(); 
    $_SESSION['form_results'] = $_POST;
    header("Location: formmail.php"); 
    And then in formmail.php:
    PHP Code:
    session_start(); 
    $question $_SESSION['form_results']['question']; 

    - Or, redirect the user to formmail.php and tag a bunch of $_GET variables on the request. Something like this:
    PHP Code:
    if(count($_POST) > 0)
        
    $q_string '?'.http_build_query($_POST);
    header(sprintf("Location: formmail.php%s"$q_string)); 
    And then in formmail.php:
    PHP Code:
    $question $_GET['question']; 
    The formmail script is jacks universal formmail.php so how would i do it with that


  •  

    Tags for this Thread

    Posting Permissions

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