passing variables from javascript to php
| From: | m.lawrie | Date: | Sat, 13 Oct 2001 17:28:17 +0000 |
| Subject: | passing variables from javascript to php | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-70987@lists.php.net to get a copy of this message | ||
<SCRIPT LANGUAGE='javascript'><!--
var array = parent.main.location.pathname;
endarray = array.split('/');
popped = endarray.pop();
splitted = popped.split('.');
linkname = splitted.shift();
document.write(linkname);
//--></SCRIPT>
<?php
include("dblink.inc");
$query = "select * from glck_zahl where game='linkname'"; etc...
?>
These two fragments are from the same file, respectively. Doubtless
inelegant. Is there a way to make my javascript variable available to
php? Alternatively, can I somehow do cross frame scripting with php?
should I try to nest some kind of javascript frames communication within
php perhaps?
many thanks for suggestions,
magnus lawrie