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

Posted by Japhy on 11/25/05 00:18

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)"

(set_cookie being a javascript function :
// set_cookie(name, value [,expires, path, domain, secure])
// Set cookie value.
function set_cookie (name,value,expires,path,domain,secure) {
document.cookie = name + "=" + escape (value) +
((expires) ? "; expires=" + expires.toGMTString() : "")
+
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
I found on the internet.
Can I set session variables likewise...in a javascript function? I
have tried to find the right syntax, and so far no luck. My other idea
was to POST when they page from 1 page to another to collect the
values, but I am already POSTING on the form to handle the validation
and input of data.
Would you suggest :
1) running some kind of JS function onblur to set the session
variables?...like I'm doing now with cookies.
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?
3) something entirely different
Thanks again!

 

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

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