You are here: Re: cookies and session variables « PHP Programming Language « IT news, forums, messages
Re: cookies and session variables

Posted by Ian on 11/25/05 00:54

Japhy wrote:
> Thanks for the reply. What you say makes sense. Right now I am using
> code in the <input for each field :
> onblur="JAVASCRIPT:set_cookie('mycookie',document.forms0].FieldA.value)"
>
> Can I set session variables likewise...in a javascript function?

Sessions are purely server side.

Use session_start() to create one and the $_SESSION super global to
store your data (which can be harvested from $_POST) between pages. No
client side code is required.


> Would you suggest :
> 1) running some kind of JS function onblur to set the session
> variables?...like I'm doing now with cookies.
Nope.

> 2) putting some kind of logic in my form handling script to distinguish
> if they are paging from 1 to another page, or 'submitting' the form?
Yes. You can use the value of your submit button for this.

> 3) something entirely different
Maybe....

Ian

 

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

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