|
Posted by Al on 09/30/40 11:27
Jasper Bryant-Greene wrote:
> Al wrote:
>
>> 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 array
>
>
> Any 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.
>
Serializing has problems with quotes, backslashs, etc. base64 makes it foolproof.
Navigation:
[Reply to this message]
|