I want to have a script that will capture /whateverthisis.html or php and post to html/php page.
So, if url is http://bubbashome.com/home-builders.html, page will show text "home-builders" on page. Does anyone know how to do this?
$path = strrchr($_SERVER[PHP_SELF],'/'); $sfile = str_replace (strrchr ($path, "."), "", $path); $file = str_replace("/","",$sfile);
so that will return thispage if you have domain.com/thispage.ext
just echo $file.
You can also look at [man]parse_url[/man].
Ok, so for php file, I would have:
<?php> $path = strrchr($_SERVER[PHP_SELF],'/'); $sfile = str_replace (strrchr ($path, "."), "", $path); $file = str_replace("/","",$sfile); ?>