[thelist] calling a php file and submitting a form? (send POST vars in PHP?)

Tom Dell'Aringa pixelmech at yahoo.com
Wed Jan 8 15:53:01 CST 2003


--- Mike Migurski <mike at saturn5.com> wrote:
> Shawn's method is better - do whatever you need to do in PHP, and
> then
> generate a POST or GET request from within PHP. GET is easier of
> course,
> so use that if the remote script supports it. POST shouldn't be too
> difficult though. (I say this never having done it before :)

Well, I can't use GET since cart.bok wants POST and I can't change
it. (If it was GET I'd have other options too).

I actually tried doing an HTTP post from an intermediate page with no
success, and I'm not keen on spending a ton of time on that.

I have however submitted the form to the same page, then picking up
on the submit name (submit=add to cart) I pop into an if clause.

>From there I used header("location: cart.bok"); which sent me right
there..which is great. Now I just need to send the POST vars along
with it. Here is my block:

$submit = $_POST["submit"];
$all_other_vars = $_POST['others'];

if($submit == "Add To Shopping Cart")
{
   header("Location: /Cart.bok");
}

This works... but is there a way to send the POST vars this way to
cart.bok? I suppose I could actually write a file using fputs() with
the info, but not sure if I could submit that file to cart.bok...

Tom

=====
var me = tom.pixelmech.webDeveloper();

http://www.pixelmech.com/
http://www.maccaws.com/
[Making A Commercial Case for Adopting Web Standards]

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



More information about the thelist mailing list