View Full Version : would it be possible...
...to pass a javascript variable into php?
$var = "<script type="Javascript">
var something;
something = "this";
</script>";
Originally posted by Neo
$var = "<script type="Javascript">
var something;
something = "this";
</script>";
wouldn't that just make the variable value
<script type="Javascript">
var something;
something = "this";
</script>
?
ivan2
10-14-2002, 09:26 PM
there you go
Hmm good point I didnt think of that one.
Maybe try this
[php]
<script type="Javascript">
var something;
something = "this";
<?php $phpvar="/?> something <?php "/ ?>
</script>
??
Takara
10-15-2002, 12:46 AM
I don't think its possible since javascript is parsed after, by the browser. But what you could do is something like
<script language="JavaScript">
function pass() {
window.location("next.php?width=" + screen.width + "&height=" + screen.height + ");
}
</script>
<body onload="pass();">
Or something simmilar.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.