Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199908

Re: [PHP3] - post & redirect From: jj <email protected>
Date: 08/24/99

Peter Sorger wrote:

> Some time ago, Jason Brooke has posted a code to pass variables to another
> page rather by POST method than the GET method
> the code was:
>
> $host="my.host.com";
> $mydata="k=$k";
> $sp=fsockopen($host,80);
> fputs($sp,"POST /index.php3 HTTP/1.1\n");
> fputs($sp,"Host: $host\n");
> fputs($sp,"Content-type: application/x-www-form-urlencoded\n");
> fputs($sp,"Content-length: ".strlen($mydata)."\n");
> fputs($sp,"Connection: close\n\n");
> fputs($sp,$mydata);
> fclose($sp);
>
> The problem is:
> When I post the variables like that, the only thing I do, is open a
> connection from php3 script to the other php3 script without getting any
> output. I tried to
>
> echo fgets($sp,1024)."<BR>";
>

Before using the fclose($sp); do this
while(!feof($sp)) {
                $cresp .= fgets($sp,1024);
        }
fclose($sp);

>
> serveral times, but while the connection was between the two scripts, it did
> not detect my browser either I could not get to any cookies or even the
> "REAL" IP, it returned the IP address of the server, where was the script
> located.
>

I'm not sure what you're asking here for ?

>
> I need something that will let MY browser post the variables to the server.
>
> Anyone gets any idea ?
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe <email protected>
> To subscribe to the digest, e-mail: php3-digest-subscribe <email protected>
> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-admin <email protected>

-- 
PHP 3 Mailing List <http://www.php.net/>
To unsubscribe, send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest, e-mail: php3-digest-subscribe <email protected>
To search the mailing list archive, go to: http://www.php.net/mailsearch.php3
To contact the list administrators, e-mail: php-list-admin <email protected>