Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript variables and php

Status
Not open for further replies.

sauser

Programmer
Aug 22, 2001
49
US
how can i use javascript variable in a php4 script?
 
well it is possible to pass javascript variables to a php script using hidden fields as i found out

 
or you can document.location (or whatever) = &quot;page.html?stuff1=<?$stuff1?>&stuff2=<?$stuff2?>&quot; ;) *muahah*

My codes look like something a kid wrote
I have absolutely no idea what I am talking about
Somehow I still manage to make it work
 
Just to get the terms clear:

JavaScript variables is probably the wrong term - unless you really mean javascript calculated values.

To transfer these values to a PHP page some kind transport via the HTTP protocol is needed, such as a form, or GET parameters on the URL string. POST (with forms) is preferable. The values have to be set to a form field so they will be available in PHP.

Cookies are ok, but what if the visitor has cookies turned off?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top