richiec Posted November 4, 2007 Share Posted November 4, 2007 alot of php sites in there url have something like www.whatever.com/site.php?page=hello ive always wonderd how to do that, im sure its pretty simple.. im asking because i just wana keep the main page the same name and have different site.php?= so like www.whatever.com/site.php?page=hello and then www.whatever.com/site.php?page=goodbye Link to comment https://forums.phpfreaks.com/topic/75975-solved-always-wonderd/ Share on other sites More sharing options...
pocobueno1388 Posted November 4, 2007 Share Posted November 4, 2007 You just simply add it to your link <a href="test.php?page=hello"> Or you can put it in your form action. Read this to help you (read about the GET method) http://www.tizag.com/phpT/postget.php Link to comment https://forums.phpfreaks.com/topic/75975-solved-always-wonderd/#findComment-384605 Share on other sites More sharing options...
richiec Posted November 4, 2007 Author Share Posted November 4, 2007 still dont get it though, all i want it to do is show a different page just putting the ?page= in the link doesnt change it to the page which the page= if you see what i mean it just shows the original page Link to comment https://forums.phpfreaks.com/topic/75975-solved-always-wonderd/#findComment-384615 Share on other sites More sharing options...
Demonic Posted November 4, 2007 Share Posted November 4, 2007 <?php $page = $_GET['page']; switch($page) { case "anotherpage": echo "THis is another page"; break; default: echo "This is the default page."; break; } ?> access that by w/e.php?page=anotherpage Link to comment https://forums.phpfreaks.com/topic/75975-solved-always-wonderd/#findComment-384617 Share on other sites More sharing options...
richiec Posted November 4, 2007 Author Share Posted November 4, 2007 thanks, that works. Link to comment https://forums.phpfreaks.com/topic/75975-solved-always-wonderd/#findComment-384626 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.