Subject: vriable from Javascript to PHP or ASP
Posted By: pb7 Post Date: 1/13/2004 10:53:49 AM
Hello,
I would like to know if it is possible to pass a variable defined in Javascript to a server-side script for processing. I suspect this is possible with ASP if Javascript is the scripting language used to build an ASP page. But what about PHP?
Thanks in advance,

Philippe

Philippe
Reply By: pgtips Reply Date: 1/13/2004 10:59:03 AM
Its the same scenario in either PHP or ASP.  You must send the value from client-side javascript to server-side ASP or PHP using a POST or similar request.

There are some cunning tricks here http://www.aspfaq.com/show.asp?id=2001 but the result is the same - it must be explicitly sent to the server.
Reply By: planoie Reply Date: 1/13/2004 2:22:26 PM
And even though an ASP page is written in JavaScript it can't "talk" with the JavaScript on the client.  This would be the same for ASP with client-side code written in VBScript or any other language which will work in both the server and client.
The server-side code runs at the server, the client-side code runs on the client.  The two are separate and apart.

Peter
------------------------------------------------------
Work smarter, not harder.

Go to topic 3800

Return to index page 970
Return to index page 969
Return to index page 968
Return to index page 967
Return to index page 966
Return to index page 965
Return to index page 964
Return to index page 963
Return to index page 962
Return to index page 961