kvarnerexpress 0 Report post Posted April 25, 2005 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. Share this post Link to post Share on other sites
snlildude87 0 Report post Posted April 25, 2005 Hmm, you can have a hidden form with hidden inputs in 1.php...1.php: <?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. Share this post Link to post Share on other sites
beeseven 0 Report post Posted April 25, 2005 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://forums.xisto.com/no_longer_exists/;);http://forums.xisto.com/ die;) 3. Use $_GET to get the data ($a = $_GET['a']; $b =$_GET['b'] Share this post Link to post Share on other sites
FaLgoR 0 Report post Posted April 26, 2005 You can do it by two ways: 1°, using hidden inputs. 2°, add the values on the url, look: <? header("Location: page.php?t1=$t1&t2=$t2&t3=$t3"); ?> Got it? =D Share this post Link to post Share on other sites
Newton 0 Report post Posted April 29, 2005 If you need the data a few page access' later then just dump it in a cookie as a concatenated string. Share this post Link to post Share on other sites