Re: Re: Posting variables from one php script to another
| From: | Al | Date: | Sat, 24 Sep 2005 00:12:20 +0000 |
| Subject: | Re: Re: Posting variables from one php script to another | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-223110@lists.php.net to get a copy of this message | ||
Jasper Bryant-Greene wrote:
Al wrote:Serializing has problems with quotes, backslashs, etc. base64 makes it foolproof.I'd use this. It's simple and doesn't involve CURL. Here is a brief outline. $file_str= base64encode(serialize($_GET)); //$_GET can be any arrayAny reason why you base64_encode here? fwrite is binary-safe so base64 encoding your data is slow and a waste of space.Create a temporary file and write your string fwrite($temp, $file_str); fetch your data with $saved_get= unserialize(base64decode(file_get_contents(filename)); Unlink your file when done with it.Rather than resort to the slow process of creating, writing, reading and deleting a file for every request (not to mention generating a unique ID to prevent collisions with simultaneous requests), I'd be more tempted to find out exactly why the OP couldn't get it working with GET variables. Perhaps he could post some more code, as I regularly pass GET variables to PHP scripts through <img> tags and the like with no problems whatsoever.