Re: JASON-> Re: [PHP] redirecting with variables *depending* on a variable
| From: | Ryan A | Date: | Wed, 30 Apr 2003 22:43:50 +0000 |
| Subject: | Re: JASON-> Re: [PHP] redirecting with variables *depending* on a variable | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145868@lists.php.net to get a copy of this message | ||
Hey,
Thanks for replying.
I solved this with simple "include"s....
Cheers,
-Ryan
----- Original Message -----
From: "Jason Paschal" <j_paschal@hotmail.com>
To: <ryan@jumac.com>
Sent: Thursday, May 01, 2003 12:34 AM
Subject: Re: JASON-> Re: [PHP] redirecting with variables *depending* on a
variable
> to do a manual post, try this:
> http://us3.php.net/manual/en/function.fsockopen.php
>
> <?php
> $fp = fsockopen ("192.168.0.3", 80);
> if ($fp) {
>
> fputs ($fp, "
> POST /localhost/test/p.php HTTP/1.1 //prodID can dictate script name
> Host: 192.168.0.3
> Content-Length: 7
> Content-Type: application/x-www-form-urlencoded
> Connection: Close
>
> a=1&b=2
>
> ");
> while (!feof($fp)) echo fgets ($fp,128);
> fclose ($fp);
> }
> ?>
>
> Host: must be the same as the server else the POST isn't accepted
> Content-lenght: is th lenght of the line of the values [a=1&b=2]
> a=1&b=2 values are writted like a GET but without ? at beginning...
>
> you can use POST and GET together with this line :
> POST /localhost/test/p.php?val=3 HTTP/1.1
>
>
>
>
>
>
>
> >From: "Ryan A" <ryan@jumac.com>
> >To: "Jason Paschal" <j_paschal@hotmail.com>
> >Subject: JASON-> Re: [PHP] redirecting with variables *depending* on a
> >variable
> >Date: Wed, 30 Apr 2003 22:31:46 +0200
> >
> >Hi,
> >Thanks for replying.
> >
> >Wouldnt that make it into a "GET" method and show it to the client?
> >I dont mind if the client sees
> >http://someserver.com/script1.php but I
dont
> >want him to see the whole string of variables/values....
> >
> >Or am i barking up the wrong tree?
> >
> >Cheers,
> >-Ryan
> >
> > > could you pass them as a query string?
> > >
> > > if ($prodID==1) {
> > > header("Location:
> >script1.php?state=$state&city=$city&prodID=$prodID");
> > > exit;
> > > } elseif ($prodID==2) {
> > > header("Location:
> >script2.php?state=$state&city=$city&prodID=$prodID");
> > > exit;
> > > }
> > >
> > >
> > >
> > >
> > >
> > >
> > > >From: "Ryan A" <ryan@jumac.com>
> > > >To: <php-general@lists.php.net>
> > > >Subject: [PHP] redirecting with variables *depending* on a variable
> > > >Date: Wed, 30 Apr 2003 22:11:10 +0200
> > > >
> > > >Hi,
> > > >can this be done:
> > > >
> > > >I will be getting a string of values and variables
> > > >($name,$product_id,$country,$state,$zip etc etc) from a POST method
> >from
> > > >address http://blahblah.com/somecgi.cgi .
> > > >Is there any way I can do this:
> > > >
> > > >if($product_id=1)
> > > >{send to php script that handles id 1 (script1.php)}
> > > >else if($product_id=2)
> > > >{send to php script that handles id 2 (script2.php)}
> > > >....etc
> > > >
> > > >the part which i am worried about is it has to send it to the new
> >script
> > > >(script1.php or script2 .php) WITH all the variables mentioned on
top.
> > > >
> > > >If you have any ideas on how this can be done please tell me, with
your
> > > >idea
> > > >of doing this would appreciate some code example/s to explain as am a
> >bit
> > > >of
> > > >a newbie myself. if giving me a code example is too much of a pain
just
> > > >point me to where i can read up on it for the next few hours :-D
> > > >
> > > >Thanks in advance.
> > > >
> > > >Cheers,
> > > >-Ryan
> > > >
> > > >
> > > >--
> > > >PHP General Mailing List (http://www.php.net/)
> > > >To unsubscribe, visit:
> > > >http://www.php.net/unsub.php
> > > >
> > >
> > >
> > > _________________________________________________________________
> > > The new MSN 8: advanced junk mail protection and 2 months FREE*
> > > http://join.msn.com/?page=features/junkmail
> > >
>
>
> _________________________________________________________________
> STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>