I need to take a URL variable into a PHP page, and then later pass it into some javascript that's in HTML later in the page. Here's where I need to use the variable:
function dosubmit( ) {
new Ajax.Updater( 'result', 'dial.php', { method: 'post' , parameters: $('dialer').serialize() } );
$('dialer').reset();
}
the URL variable is formatted as dialout.php?ext=1234. It is stored in PHP as $ext. result is the div that returned html will be placed in, and dialer is a form that a user would enter a phone number into; I need to pass it along with the $ext variable to dial.php. My thought was to concatenate the two, as
var ext = "<? $uext ?>";
var par = $('dialer').serialize();
var url = par;
and then using url in place of $('dialer').serialize()
. This does not work, though; dial.php reports never gets the ext
variable. What's the best way to move a URL variable into PHP, then into js, then post it back to PHP? I apologize in advance if I've mis-explained something, this is all new to me.
Thanks!