By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,723 Members | 1,414 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,723 IT Pros & Developers. It's quick & easy.

Sending post variable

P: n/a
Hi all.

I have a script with a form

<form action="a.php" ... method="post">
<input name="field" ...>
</form>

a.php gets the variable with

$a = $_POST['field'];

How can I send $a to another script via POST?
I have another script that needs some fields using POST.
1) The user sends a form to a.php
2) a.php adds some fields and sends all to another script using POST.

With GET I would get

header('Location: b.php?k=h&newfield=' . $a);

But with POST?

Any ideas?

G.

Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Wed, 11 May 2005 08:38:19 GMT, J˙Giusł vs ::NRG::ius wrote:
How can I send $a to another script via POST?


Did you try google?! First hit:
http://www.alt-php-faq.org/local/55/#id55
--
Firefox Web Browser - Rediscover the web - http://getffox.com/
Thunderbird E-mail and Newsgroups - http://gettbird.com/
Jul 17 '05 #2

P: n/a
You would be better to do this with session variables:
http://www.phpfreaks.com/tutorials/41/0.php

Jul 17 '05 #3

P: n/a
J˙Giusł vs ::NRG::ius wrote:
<snip>
How can I send $a to another script via POST?
As someone already pointed out you can mimic a HTTP POST using PHP.
With GET I would get

header('Location: b.php?k=h&newfield=' . $a);

But with POST?


POST redirection can be done with "303 See Other" HTTP status
<http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#c111577953637573243>,
*AFAIK*. But, I never got that working.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.