Welcome to WebmasterWorld Guest from 126.96.36.199 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Become a Pro Member
take keywords from url, use them on page invisible777
how can i do the following...
user types in my www.mydomain.com/anywordhere
how can i echo the 'anywordhere' onto the page?
Welcome to WebmasterWorld, invisible777.
You should be able to parse out the pieces you need from one of PHP's
$_SERVER [ php.net]superglobal variables. invisible777
Hi, thanks for the reply. I have this piece of code:
$keys = explode("-",str_replace(array("http://",".php"),"",$_SERVER['SCRIPT_URI'])); echo $keys."<br>".$keys;?>
which requires the page exist... whereas i just need something that allows the user to type in www.mydomain.com/absolutelyanythinghere and then i suppose to be redirected to an index.php where 'absolutelyanythinghere' can be echoed onto the page...
you can pass that string to index.php as parameter
and then in index.php
use get to get paremeter
$string = $_GET['invalidpage'];
then display value of the variable
echo $string; invisible777
sorry im not following... how does that redirect occur if the original invalid page does not exist? milanmk
You need to add the following code to your .htaccess file.
RewriteRule ^([^/]+)$ /index.php?invalidpage=$1 [L]
And your index.php will be