Why does this not work?
var data1 = "<? http_build_query($_GET); ?>";
var data2 = "buy.php?";
var url = data2+data1
document.getElementById('framebox').src = url;
Thanks.
Why does this not work?
var data1 = "<? http_build_query($_GET); ?>";
var data2 = "buy.php?";
var url = data2+data1
document.getElementById('framebox').src = url;
Thanks.
Because data1
is empty (PHP is not outputing anything), try:
var data1 = "<?= http_build_query($_GET); ?>"; // or
var data1 = "<?php echo http_build_query($_GET); ?>";
Any reason you're using PHP to build the query string instead of doing it directly in Javascript?
You can also archive it the plain old pure javascript way:
var data1 = location.href.split('?').pop();
var data2 = "buy.php?";
var url = data2+data1
document.getElementById('framebox').src = url;
But it's much more fun to mix stuff.....