Hey guys, I have a doubt Im using an Array to control the URLS of my site... if the record exists on the array then the include is made... but when I try to use for instance:
main.php?page=Production&prod=EditProduction?c_id=18&prod_id=3;, it gives me an error... I understand that it might be because the array does not have the "?c_id=18&prod_id=3"... I tried to add that to the array names... and their contents.. but it return me error because the URL is not "authorized".. I woud like to continue securing the URLs that are allowed in my site... but I dont know how to make it dynamic enought to accept the sessions variables that I'll need, also how can I retrieve the URL values to use i my page?
Heres the code I', using to manage the includes in this area:
//SCRIPT TO CONTROLE THE URLS ON THE SITE:
<?php
ob_start();
// 1. Define an array of allowed URLS:
$productions = array(
'Manage' => 'production/createProduction.inc.php',
'CreateProduction' => 'production/createGeneralProduction.inc.php',
'EditProduction' => 'production/editGeneralinfo.inc.php'
);
$prod = 'Manage';
$_SESSION['prodID'] = $prodID;
?>
<?php
if($prod != 'Manage' && $prod != 'CreateProduction'){
echo '<div id="productionCreationMenu">
<h4>General Info | <a href="/myGreenRoomtest.php?page=performance">Performances</a> | Manage Rehearsals | Add Documents | Add media</h4></div>';
}
if($prod != 'Manage' && $prod != 'CreateProduction'){
echo '<div id="playName" style="background-color:#D0E89F">'.$row_playInfo['play_Name'].':</div>';
}
if(isset($_GET['prod']) /*&& array_key_exists(($_GET['prod']), $productions)*/){
$prod = $_GET['prod'];
include($productions[$prod]);
}elseif (!isset($_GET['prod'])){
include ('production/createProduction.inc.php');
} else {
// This sends the 404 header:
header("HTTP/1.0 404 Not Found");
// This includes the error page:
include ('includes/error.php');
}
ob_flush();
?>
//THIS IS WHAT i WOULD LIKE TO PASS:
http://localhost/SITE/main.php?page=Production&prod=EditProduction?c_id=18&prod_id=3;
How can i do that? :S make the array accept those differences on the URL and how can I use that on the next page? :S
Thank you guys very very much.