There is a div of content that I want to only have shown on the home page of my site. (index.php). Is there anyway to do this with php, based on the URL (index.php)?
<? if(basename($_SERVER['PHP_SELF']) == "index.php") { ?> #create html elements here or maybe use function readfile <? } ?> Code (markup): include code in all files...
this should work if(strtolower($_SERVER['SCRIPT_NAME'])=='/index.php'){ //do stuff } PHP: (forgot to click submit >.<)