Jump to content

Php Multiple Pages Per One File


gmz1023

Recommended Posts

Hey y'all,i'm working on a website right now and i have a quick question about PHP.so lets say i have a code like thisCODE<?php$cmd = $_GET['cmd'];switch($cmd){case "page1":@include('page1.php');break;case "page2":@include('page2.php');break;case "page3":@include('page3.php');break;}?>and i want to make it so that instead of having to program the codes for the websites in manually it would just go off of the link it self, how would i do that?

Link to comment
Share on other sites

$cmd = some_sanitize_function($_GET['cmd']);include($cmd.php);

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...