|
|
|
|
![]() ![]() |
Apr 25 2005, 09:18 PM
Post
#1
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 407 Joined: 13-December 04 Member No.: 2,696 |
I have a form, from where the data is being posted to a php script. Now in the php script the script has to forward the data to another script with posted data. I know this can be done using header but i don't know how to keep the data posted with form in POST method.
For example: The form below: Code: <form method="POST" action="1.php"> <input type="hidden" value="abc" name="t1"> <input type="submit"> </form> Now its posting data using POST method to 1.php...and now 1.php will redirect everything to another php script with the data and it should be in POST method ... How can i do this ? Thanks. |
|
|
|
Apr 25 2005, 09:29 PM
Post
#2
|
|
|
Moderator ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 2,325 Joined: 8-March 05 From: Mawson, Antarctica Member No.: 4,254 |
Hmm, you can have a hidden form with hidden inputs in 1.php...
1.php: CODE <?php echo "<form method=\"POST\" action=\"[url of script to send info]\">\n\t"; echo "<input type=\"hidden\" name=\"[name of your choice]\" value=\"[value of the data from previous script]\">\n"; echo "<form>\n"; ?> I hope this made sense, but this is essentially what you did in your example... I'm still a newbie to PHP, so I'm trying the best I can to help you. |
|
|
|
Apr 25 2005, 09:45 PM
Post
#3
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 629 Joined: 26-February 05 Member No.: 3,995 |
I'm not sure I completely understand, but I think you could do this:
1. Get the data from the form ($a = $_POST['a']; $b = $_POST['b'];) 2. Redirect with the data in the url (header("Location: http://aaa.aaaaa.aaa/ab.php?a=a&b=b"); die;) 3. Use $_GET to get the data ($a = $_GET['a']; $b =$_GET['b'];) |
|
|
|
Apr 26 2005, 05:07 PM
Post
#4
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 217 Joined: 2-January 05 Member No.: 3,084 |
You can do it by two ways: 1°, using hidden inputs. 2°, add the values on the url, look:
CODE <? header("Location: page.php?t1=$t1&t2=$t2&t3=$t3"); ?> Got it? =D |
|
|
|
Apr 29 2005, 11:30 AM
Post
#5
|
|
|
Newbie [Level 1] ![]() Group: Members Posts: 11 Joined: 19-April 05 Member No.: 5,902 |
If you need the data a few page access' later then just dump it in a cookie as a concatenated string.
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 7th October 2008 - 08:44 AM |