Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
| Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 13th, 2004, 11:53 AM
pb7 pb7 is offline
Authorized User
Join Date: Jun 2003
Location: Lancaster, , United Kingdom.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default vriable from Javascript to PHP or ASP

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,


Old January 13th, 2004, 11:59 AM
Friend of Wrox
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post

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.
Old January 13th, 2004, 03:22 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

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.

Work smarter, not harder.

Similar Threads
Thread Thread Starter Forum Replies Last Post
php and javascript rakesh nair Pro PHP 1 March 21st, 2007 05:58 PM
php and javascript jfern PHP How-To 4 November 23rd, 2006 02:31 AM
PHP, PERL, HTML, JAVASCRIPT, ASP mani_he PHP How-To 3 February 11th, 2005 06:46 PM
javascript with php kuehhc Beginning PHP 8 February 1st, 2005 10:59 PM
PHP with Javascript Droobles Pro PHP 1 February 17th, 2004 03:08 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.