Page 1 of 1

reload page - please help

Posted: Wed Jan 05, 2011 6:45 pm
by Zurawolf
Hi,

Could you write me code for reload index.php page using "onload" and sending $x=1 at the same time .


Thanks,

Zurawolf

Re: reload page - please help

Posted: Wed Jan 05, 2011 8:48 pm
by spedula
May I ask why?

Code: Select all

<?php
if (!$_GET) {
	?>
    <form name="formName" action="index.php" method="get">
    <input type="hidden" value="1" name="x" />
    </form>
    <script>
		document.formName.submit()
	</script>
    <?php
}

else {
	$x = $_GET['x'];
	echo $x; // or whatever you want to do with the value
}
?>