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?
just link to the page you want to refresh with php_self. <a href="<?php echo $_SERVER["PHP_SELF"] ?>">Refresh</a> Code (markup):
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> PHP:
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!