Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> How To Redirct Post Data ?
kvarnerexpress
post 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.
Go to the top of the page
 
+Quote Post
snlildude87
post 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. smile.gif
Go to the top of the page
 
+Quote Post
beeseven
post 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'];)
Go to the top of the page
 
+Quote Post
FaLgoR
post 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
Go to the top of the page
 
+Quote Post
Newton
post 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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Help With Reading Files(5)
  2. Listing From Table Row Data(5)
  3. Finding Data In Meta Tags(0)
  4. Same 1 Registeration Data For Different Purposes(4)
  5. Loading Mysql Data Into A Table(10)
  6. How Good Is This Data Cleaning Function?(2)
  7. Putting Data Of 2 Pages In Mysql At Once(1)
  8. Problems With Data Formatting(2)
  9. What Does This Do?(4)
  10. Using Multiple Selection Array In Table To Order Data(1)
  11. Php Email Validation(1)
  12. Php + Mysql Question!(4)


 



- Lo-Fi Version Time is now: 7th October 2008 - 08:44 AM