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????? 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 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. Link to comment https://forums.phpfreaks.com/topic/264464-hiding-variables-in-url/#findComment-1355286 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.