Log In · Register

 
PHP variables and stuffs
Mikeplyts
post Feb 15 2010, 09:51 PM
Post #1


Mel Blanc was allergic to carrots.
*******

Group: Official Designer
Posts: 6,371
Joined: Aug 2008
Member No: 676,291



I'm working on a little something-something and I was wondering if I could use variables or placeholders or whatever in a switch function based on the URL. Sort of like Apache.

Um, something like this:
CODE
<?php
$uri = $_SERVER['SCRIPT_NAME'];

switch($uri) {
    case '/$1/$2/$3/index.php':
        echo 'Under 3 directories.';
        break;
    case '/$1/$2/$3/$4/index.php':
        echo 'Under 4 directories.';
        break;
}
?>


Get what I mean? And yes, I've tried the above but it doesn't seem to work. tongue.gif Help would be appreciated.
 

Posts in this topic


Closed TopicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members: