Romeo Manzur wrote:
> 
> hi, I want to know how could I save a javascript variable on a php
> variable???
> Thanks...

It depends how the user will get to the php page: 

1. Form
If the user is about to submit a form and you want some
Javascript variable from
your page to end up as a php variable after the form is
submitted then:

Create a hidden form variable e.g. <INPUT TYPE=HIDDEN
NAME="myvariable">
Set this formvariable to your Javascript variable in the
Javascript
e.g.   document.form.myvariable.value =
myjavascriptvariable; 

After submission $myvariable will be a php variable in the
target page with the value you gave it.

2. Link
If you want to set a php variable in a page which the user
will get to by a link,
then you need to add a GET query to the link e.g. your
Javascript will have something like this:
document.myhref.location =
document.myhref.location+"?myvariable="+myjavascriptvariable;
i.e. the link becomes   myoriginallink?myvariable=...
php will automatically become up the value you specify and
set $myvariable to that value.

 
George

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to