Solved

how do i pass info from javascript to php

Posted on 2008-06-13
3
178 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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…

805 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