Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- session_test.php
- */
- session_start();
- $arr = explode('/', $_SERVER["REQUEST_URI"]);
- if( count($arr) > 2 )
- {
- $name = $arr[2];
- if($name == 'clear')
- {
- session_destroy();
- }
- elseif( count($arr) > 3)
- {
- $value = $arr[3];
- $_SESSION[$name] = $value;
- }
- else
- {
- unset($_SESSION[$name]);
- }
- }
- echo '<html>';
- echo '<head>';
- echo '<script src="THISENDSUPINSESSION.js"></script>';
- echo '</head>';
- echo '<body>';
- echo var_export($_SESSION,true);
- echo '</body>';
- echo '</html>';
- /*
- To try:
- session_test/id/1
- session_test
- gives me:
- id => 'THISENDSUPINTHESESSION'
- */
Add Comment
Please, Sign In to add comment