So i've made a website using PHP, MySQL, and AJAX. Everything in my website requires the use of Javascript, and its pretty much useless otherwise, so i found and modified a script i found online to use PHP to determine if the user has Javascript enabled:
<?php
$js = array_key_exists('js', $_POST) ? $_POST['js'] : '';
if ($js == '')
{
$js = 'off';
?>
<form id="tester" action="<?php if(isset($_GET['page'])) { echo $PHP_SELF.'?page='.$page;
}
else { echo $PHP_SELF; } ?>" method="post">
<p>
<input type="hidden" name="js" value="on" />
</p>
</form>
<script type="text/javascript"><!--
document.getElementById('tester').submit()
//-->
</script>
My problem is, say if i had the url [url]http://.../index.php?page=content.php&id=1[/url]
The line in my javascript checker:
$PHP_SELF.'?page='.$page;
will only output [url]http://.../index.php?page=content.php[/url] as the URL, dropping the remaining
&id=1
How would i go about makign it so that the FULL url path after "page=" will be used?