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

Joe Lance JoeL at HUMBOLDTBANK.COM
Wed Jan 8 16:29:01 CST 2003


Tom,
This might help you out (link taken from the php manual)
An example to send POST data using fsockopen can be seen here:
http://www.faqts.com/knowledge_base/view.phtml/aid/12039/fid/51

-----Original Message-----
From: Tom Dell'Aringa [mailto:pixelmech at yahoo.com]
Sent: Wednesday, January 08, 2003 1:53 PM
To: thelist at lists.evolt.org
Subject: Re: [thelist] calling a php file and submitting a form? (send
POST vars in PHP?)



--- 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
--
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !



More information about the thelist mailing list