Hi $5 (Paypal only) to whoever answers this question first (and works for me). (Post your answer in the thread for fairness) I have a page where the main content area pulls its data from <?php include 'home.php'; ?> PHP: I want to have another page that, instead of, using home.php it uses about.php And need to be able to switch this via the URL eg. www.website.com/index.php?page=about www.website.com/index.php?page=services www.website.com/index.php?page=contactus etc etc If that makes any sense. Thanks!
switch ($_GET['page']) { case "about": include 'about.php'; break; case "services": include 'services.php'; break; case "contactus": include 'contactus.php'; break; } PHP:
Replace your php line with this switch ($_GET['page']) { case "about": include 'about.php'; break; case "services": include 'services.php'; break; case "contactus": include 'contactus.php'; break; default: include 'home.php'; } PHP:
$page = $_REQUEST['page']; switch ($page) { case "about": include 'about.php'; break; case "services": include 'services.php'; break; case "contactus": include 'contactus.php'; break; } PHP: add that code under the <?php include 'home.php'; PHP:
Thanks for that, I appreciate it. Rep added. Feel free to shoot me a PM if your ever $5 short on something PM me with a site you own and I'll give you a backlink on a PR site for a couple months
One more thing. [b]if(isset($_GET['page'])){[/b] switch($_GET['page']){ .... } [b]}[/b] Code (markup): Make it like that .