You are here: Re: [PHP] Re: Posting variables from one php script to another « PHP « IT news, forums, messages
Re: [PHP] Re: Posting variables from one php script to another

Posted by Al on 10/23/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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация