Sending post variable

This is a discussion on Sending post variable within the PHP Language forums, part of the PHP Programming Forums category; Hi all. I have a script with a form <form action="a.php" ... method="post"&...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-11-2005
J˙Giusł vs ::NRG::ius
 
Posts: n/a
Default Sending post variable

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.



Reply With Quote
  #2 (permalink)  
Old 05-11-2005
Ewoud Dronkert
 
Posts: n/a
Default Re: Sending post variable

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/
Reply With Quote
  #3 (permalink)  
Old 05-11-2005
DJ Craig
 
Posts: n/a
Default Re: Sending post variable

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

Reply With Quote
  #4 (permalink)  
Old 05-15-2005
R. Rajesh Jeba Anbiah
 
Posts: n/a
Default Re: Sending post variable

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/

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 11:15 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0