Calling PHP from a javascript event.

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
Longlands
Forum Newbie
Posts: 15
Joined: Tue Oct 25, 2005 3:36 am

Calling PHP from a javascript event.

Post by Longlands »

I have a webpage that is created with a combination of HTML/CSS and Javascript.

What I want is to wait for a button to be clicked on the page and then call a php script to pull some content from a MySql database and echo is as a set of radar buttons into a specific position on my page. I have to call the PHP after the button is clicked because some user-input data will be passed from a javascript variable to the php script.

However I don't know how - or even if it is possible - to call a php script from a Javascript onmousedown event. I should add that the onmousedown event is already being checked to do something else in the javascript.

Any ideas? Please? :?

Martin.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Either AJAX, or just use window.location='thescript.php'; ;)
pilau
Forum Regular
Posts: 594
Joined: Sat Jul 09, 2005 10:22 am
Location: Israel

Post by pilau »

d11wtq wrote:Either AJAX, or just use window.location='thescript.php'; ;)
What is AJAX? I hear this name everywhere I go
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Asynchronous JavaScript and XML

http://en.wikipedia.org/wiki/AJAX
Post Reply