Jump to content

Url Parameterizing


tobimichigan

Recommended Posts

//setup array of allowed actions
$actions = array("login","logout","etc");

$action = "index"; //set it to index by default

//if action exists and is an allowed action, take it in
if(isset($_GET['action']) && in_array($_GET['action'],$actions)){
      $action= $_GET['action'];
}

//have a folder called actions with login.php and logout.php etc that control the processes behind those processes
require_once('actions/'.$action.'.php');

 

 

Link to comment
https://forums.phpfreaks.com/topic/167779-url-parameterizing/#findComment-884766
Share on other sites

//setup array of allowed actions
$actions = array("login","logout","etc");

$action = "index"; //set it to index by default

//if action exists and is an allowed action, take it in
if(isset($_GET['action']) && in_array($_GET['action'],$actions)){
      $action= $_GET['action'];
}

//have a folder called actions with login.php and logout.php etc that control the processes behind those processes
require_once('actions/'.$action.'.php');

 

Wayne, thanks for your reply..but wait a minute, where would all these code go? On a sepearte php page, or on the same folder as the variable pages login, logout etc?

Link to comment
https://forums.phpfreaks.com/topic/167779-url-parameterizing/#findComment-884787
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.