Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP 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 November 30th, 2005, 10:14 PM
Registered User
 
Join Date: Nov 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default PHP & JavaScript variables?

Can PHP and JavaScript write to variables that each can share?

For example, if I define a variable with a JavaScript, can I use that variable with a PHP script? ...and vice-versa?

Thanks!

Mike L
 
Old December 1st, 2005, 08:29 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 1 Time in 1 Post
Default

Mike,
I use to do this when validating form from HTML.
It can be done, but the problem you need be an expert in
scripting JavaScript & PHP. I recommend you to use
JavaScript on the client side and PHP in the server side.
Use both is very complicated.
John

 
Old December 2nd, 2005, 08:18 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

(Interactive) JavaScript validation is done to prevent delay, discomfort for the user, while submitting a form.

Server-side validation is essential to prevent scraps loading your database.

Note that, communication b/w PHP & JavaScript is not an issue; people rarely do it.

`~@#\^%&*/\.<.\/-|+|_!:;..=?>
Students' finances





Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP & JavaScript variables? mlewitz PHP Databases 2 November 30th, 2005 10:16 PM
Passing PHP variables to javascript wfrisch Pro PHP 10 April 5th, 2005 05:13 AM
Javascript & PHP rajuru Beginning PHP 6 February 22nd, 2005 06:15 AM
passin javascript variables to another page in php ismnanie Javascript 0 January 26th, 2005 01:24 AM
Q. How do I pass PHP variables to JavaScript? Snib PHP FAQs 0 April 8th, 2004 11:34 AM





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