...

View Full Version : Php Resend form data



smooch101
03-08-2009, 01:17 PM
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?

mdg583
03-08-2009, 05:15 PM
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:


session_start();
$_SESSION['form_results'] = $_POST;
header("Location: formmail.php");


And then in formmail.php:


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:


if(count($_POST) > 0)
$q_string = '?'.http_build_query($_POST);
header(sprintf("Location: formmail.php%s", $q_string));


And then in formmail.php:


$question = $_GET['question'];

smooch101
03-09-2009, 02:18 AM
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:


session_start();
$_SESSION['form_results'] = $_POST;
header("Location: formmail.php");


And then in formmail.php:


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:


if(count($_POST) > 0)
$q_string = '?'.http_build_query($_POST);
header(sprintf("Location: formmail.php%s", $q_string));


And then in formmail.php:


$question = $_GET['question'];


The formmail script is jacks universal formmail.php so how would i do it with that



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum