Jump to content

passing variables into php


aaronlzw_21

Recommended Posts

You try to mess php and javascript in an improper way. PHP is parsed and interpreted on the server before javascript is being executed on the client's machine, so you can't directly assign a php variable some value that's generated by javascript. You have to do a separate request by using hidden form fields, then assign these fields some values with javascript and finally you have to submit this form using frmData.submit()

Good Luck!
Hi,,

check for some terms like AJAX/XMLHttpRequest method,,
I've recently put an example there: [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=90550\" target=\"_blank\"]XMLHttpRequest[/a]

So, the script sends javascript values to php using the $_POST method, & php part then updates the database, 'saving changes dynamically', without reloading the page,

You can do the same thing querying and recuperating some values from php -> javascript without reloading the all page, still using some XMLHttpRequest methods,,

Hoping it helps,

l8tr,,

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.