Solved

how do i pass info from javascript to php

Posted on 2008-06-13
3
176 Views
Last Modified: 2008-06-13
how do i pass info from javascript to php
i have a var in javascript that i want to pass to a var in php
0
Comment
Question by:mgtm3
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
brad2575 earned 250 total points
ID: 21781798
You can not to that unless you submit a form or use a querystring variable.

PHP is a serverside script and is only run WHEN the page loads.  javascript is client side and runs on the users machine AFTER the page loads.
0
 
LVL 54

Assisted Solution

by:b0lsc0tt
b0lsc0tt earned 250 total points
ID: 21783160
mgtm3,

A cookie can be another way but the common and easy ways were mentioned above.

Let me know if you have any questions or need more information.

b0lsc0tt
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 21783776
I'm glad I could help.  Thanks for the grade, the points and the fun question.

bol
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Log4Net custom Appender not being fired. 5 45
JavaScript error 1 34
Understanding Trigger in Jquery 10 28
getting id from database 5 24
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now