[eluser]jstine[/eluser]
That's far more elegant than my solution: Here's what I'm using on my server - I can't post my actual link as it's for my actual production environment, but this is the working code:
Code:
<?php
if($_GET['key'] == "r4yt7WwQrte99")
{
error_reporting(-1);//E_ALL | E_STRICT);
ini_set('display_errors',1);
// this filename can be renamed to suit your requirements
$filename = $_SERVER['PHP_SELF'];
// check to see if a parameter path has been passed
if (isset($_GET['new_application_path']))
{
session_start();
// set session variable to be used in index.php
$clean = $_GET['new_application_path'];
$_SESSION['_MENU_'] = str_replace("\\\\","\\",$clean);
//print_r($_GET);
//echo "<br />";
//print_r($_SESSION['_MENU_']);die;
// Redirect browser
header("Location: http://" . $_SERVER['SERVER_NAME'] . "/index.php");
exit;
}
// SESSION RESET EVERYTIME if and only if no GET parameter variable passed
session_unset();
session_start();
$_SESSION['js_counter'] = 0;
// set your application paths here
$ci_application_paths = array
(
'ci_application',
'ci_sandbox',
);
define('LOCALHOST', 'localhost' === $_SERVER['SERVER_NAME']);
$html_title = 'Application Selector';
//=====================================================
function j_clean($row)
{
$row = str_replace('<i>','',$row);
$row = str_replace('</i>','',$row);
return $row;
}//endfunc j_clean()
// ================ endof Php stuff ===================
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd">
<html >
<head>
<title><?php echo $html_title;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="author" content="John_Betong" />
<meta name="keywords" content="CodeIgniter Menu" />
<meta name="description" content="My Menu - maybe the best thing since sliced bread?" />
<meta http-equiv="imagetoolbar" content="no" />
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<style type='text/css'>
html {border:0; margin:0; padding:0}
body {font-family:"Lucida Grande",verdana,arial,helvetica,sans-serif;font-size:100%}
i {color:#f00; font-weight:700;font-size:1.20em}
body {background:#627AAD none; color:#00f}
a,
pre,
#container {background:#CECECE none; color:#000; border:solid 1px; padding:1em}
#container {width:40%;margin:4em auto}
pre,
#button {background-color:#fff;margin:2em 0}
a,
#button {font-size:1.0 em}
a {float:right}
</style>
</head>
<body>
<div id='container'>
<h1><?php echo $html_title;?></h1>
<br />
<h2>Select application to run</h2>
<?php /* CI application paths */ ?>
<form action='<?php echo $filename;?>'>
<dl>
<?php
foreach($ci_application_paths as $row):
echo '<dd>';
echo "<input type='radio' name='new_application_path' value='";
echo j_clean($row);
echo "' /> " .$row;
echo "</dd>";
endforeach;
?>
<dt>
<input type="hidden" name="tx" value="r4yt7WwQrte99" />
<input type="submit" value=" Start MeCritic Application " id='button'/>
</dt>
</dl>
</form>
<?php if(LOCALHOST) { ?>
<h4>$_SERVER</h4>
<pre>
<?php print_r( $_SERVER);?>
</pre>
<h4>$_SESSION</h4>
<pre>
<?php print_r( $_SESSION);?>
</pre>
<?php } ?>
</div><?php /* container */ } else { echo "You don't have permission to access this file. Please send an email to [email protected] if you feel this is incorrect.";}?>
</body>
</html>
And this is called via -
http://www.thedomain.com/ci_menu/index.p...t7WwQrte99
As I mentioned before if you wanted to give a temporary link to a third party you could add and additional key value at the top to allow for your 3rd party link.
Thanks again for all the help getting the script up and running! And I'm glad I could contribute back if even in concept.