sith717 Posted September 17, 2008 Share Posted September 17, 2008 How do people make a site with the "index.php?action=blabla" I always wanted to know how people did that.. Post a tutorial or link to the post. Link to comment https://forums.phpfreaks.com/topic/124571-make-a-site-run-of-1-page/ Share on other sites More sharing options...
genericnumber1 Posted September 17, 2008 Share Posted September 17, 2008 There are many many many ways they're doing this. They could be using MVC and the action calls a controller (or something else if their implementation is different), they could be using a simple file include based upon the query string, etc. There's no real reason to do it unless it makes what you're doing easier. If you meant how do you get the "blabla" it's contained in the $_GET array as $_GET['blabla']. Link to comment https://forums.phpfreaks.com/topic/124571-make-a-site-run-of-1-page/#findComment-643421 Share on other sites More sharing options...
dezkit Posted September 17, 2008 Share Posted September 17, 2008 one way: <?php $action = $_GET["action"]; if($action == "blabla"){ echo "BLAH BLAH, YO."; } ?> Link to comment https://forums.phpfreaks.com/topic/124571-make-a-site-run-of-1-page/#findComment-643433 Share on other sites More sharing options...
chronister Posted September 17, 2008 Share Posted September 17, 2008 I used to build like that as it was easier to include the file needed as directed by the ?action=thePageName But then I figured out a better way of building pages with 1 layout page and the rest are content pages as that was the ultimate goal. Most of my actual pages look like this.... <?php $page_title = 'Page Title'; include($_SERVER['DOCUMENT_ROOT'].'/header.php'); ?> The content goes here <?php footer(); ?> I use this method to create pages quickly. I make my layout page 1 time and determine a spot in the page where the content will actually change and then implement it using the above structure. If your interested in learning more about this, then I will get you the links to the numerous posts I have given in this board regarding it. Nate Link to comment https://forums.phpfreaks.com/topic/124571-make-a-site-run-of-1-page/#findComment-643452 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.