Re: Re: Posting variables from one php script to another

From: Date: Fri, 23 Sep 2005 21:15:35 +0000
Subject: Re: Re: Posting variables from one php script to another
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-223100@lists.php.net to get a copy of this message
thanks.... Well, I had to try As an alternative, if I: 1) posted variables to a script with curl $ch = curl_init ("path2myScript/movieBuilder.php"); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST,1); curl_setopt ($ch, CURLOPT_POSTFIELDS, "mask=mask.gif&drag=drag.gif&movie=fonovisa.mov"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $buffer = curl_exec($ch); // execute the post //echo $buffer; curl_close ($ch); } 2) write the 'src' attribute as './movieBuilder.php' with no variables passed $xml = <<<EOB <?xml version="1.0"?> <?quicktime type="application/x-quicktime-media-link"?> <embed src="./movieBuilder.php"/> EOB; Would the movieBuilder.php file retain the POST'ed variables ? Or, would they be lost in the void. maybe this approach is silly? g On Sep 23, 2005, at 1:25 PM, Jasper Bryant-Greene wrote:
Graham Anderson wrote:
The below method is the way I send variables to the movieBuilder.php file [located in the 'src' attribute] with GET Variables It does work :) How would I use CURL to POST the same variables to the movieBuilder.php file WITHIN the 'src' attribute ?
You can't. Browsers make a GET request for the URL listed in the /src/ attribute, and there's nothing you can do about that. PHP doesn't have anything to do with that /src/ attribute, it just prints it out and the browser parses it. On recent Mozilla browsers you can use XMLHTTPRequest to fetch a base64-encoded stream of your data and write it to the src attribute within a "data:" URI scheme, but that won't work on IE or many other browsers. -- Jasper Bryant-Greene Freelance web developer http://jasper.bryant-greene.name/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#223100) next »