NYCPHP Meetup

NYPHP.org

[nycphp-talk] back button, page timeout, sessions

Jeff Siegel jsiegel1 at optonline.net
Fri Jan 30 14:26:00 EST 2004


Where possible, I use GET instead of POST. Depending on the nature of 
the data that has to go into the URL, you could just send it out "in the 
clear" such as "dealer_search_results.php?Categories=2&State=Maine" 
while making sure, in your "receiving" code, that no one has mucked with 
the data by putting in inappropriate values.

However, I've become a big fan of taking the stuff like above, creating 
an array and encoding it (using base64encode and serialization) and 
appending it to the URL like below.

/small_ad.php?code=YToyOntzOjY6Ik15TWFrZSI7czozOiJBTUMiO3M6NjoiQWRUeXBlIjtzOjM6ImNhciI7fQ==

On the receiving end, when I unserialize and decode, if there is a 
problem, I know the user mucked with the URL so I just redirect them to 
some generic page.

Jeff Siegel

Mark Armendariz wrote:

> Very basic way of solving is to use GET instead of POST, which is good for
> searches and such, but not good for hiding files, multi-select fields and
> textareas.
> 
> Mark
> 
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
> 

-- 
Found on the Simpson's Website:
"Ooooooh, they have the internet on computers now!"




More information about the talk mailing list