View Full Version : Button with refresh function
hrdmn
Jun 9th 2007, 10:31 am
Hey everybody ..
every one of you knows the refresh button in every browser and accordingly it function.
Can anyone tell me how to make a text/button/image in a web site to have the same function?
stOx
Jun 9th 2007, 10:49 am
just link to the page you want to refresh with php_self.
<a href="<?php echo $_SERVER["PHP_SELF"] ?>">Refresh</a>
krakjoe
Jun 9th 2007, 11:10 am
You'd be better off using REQUEST_URI as that includes the request_uri of the document, PHP_SELF is the script name only.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="javascript">
function reloadPage( )
{
document.location.href = '<?=$_SERVER['REQUEST_URI'] ?>';
}
</script>
</head>
<body>
<input type="submit" name="refresh" value="Refresh" onclick="reloadPage();" />
<a href="javascript:reloadPage();">Refresh</a>
</body>
</html>
hrdmn
Jun 9th 2007, 11:35 am
thanks, krakjoe!
that's what i need cause when i tried php_self.. it turned me back to my homepage... so that works just fine ;)
thanks a lot again!
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.