?
Solved

how do i pass info from javascript to php

Posted on 2008-06-13
3
Medium Priority
?
185 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 1000 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 1000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month16 days, 7 hours left to enroll

850 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