mattm1712 Posted June 19, 2012 Share Posted June 19, 2012 i was wondering how i would go about this say <a href='index.php?page=home'>Home</a> <?php $page= $_GET['page']; if($page=="home") { echo "hello"; } ?> but now would i hide the ?page=home????? Quote Link to comment https://forums.phpfreaks.com/topic/264464-hiding-variables-in-url/ Share on other sites More sharing options...
xyph Posted June 19, 2012 Share Posted June 19, 2012 Why would you want to do that? Check out mod_rewrite if using Apache Quote Link to comment https://forums.phpfreaks.com/topic/264464-hiding-variables-in-url/#findComment-1355282 Share on other sites More sharing options...
Andy-H Posted June 19, 2012 Share Posted June 19, 2012 That's not possible, if you use GET variables they will be displayed in the URL, you could make it neater using mod_rewrite: .htaccess <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+[^/])$ index.php?page=$1 [NC,L,QSA] </IfModule> Untested. Quote Link to comment https://forums.phpfreaks.com/topic/264464-hiding-variables-in-url/#findComment-1355286 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.