yuckysocks Posted January 31, 2008 Share Posted January 31, 2008 Hi, I want to make a simple script that changes a menu's style based on what the active page is. the code I have now is thusly: <?php $currentPage = basename($_SERVER['SCRIPT_NAME']); ?> <ul> <li><a href="index.php" <?php if ($currentPage == 'index.php') {echo 'id="here"';} ?>>Exchange Home</a></li> <li><a href="nechps.php" <?php if ($currentPage == 'nechps.php') {echo 'id="here"';} ?>>Northeast...... I've tried one-line scripts that read either: <?php echo basename($_SERVER['SCRIPT_FILENAME'], '.php'); ?> or <?php echo basename($_SERVER['SCRIPT_NAME']); ?> to define the variable, but both simple scripts return "php.cgi". I know that this means my server is running php via cgi... is there a workaround to gain similar functionality? Alex Link to comment https://forums.phpfreaks.com/topic/88759-php-running-under-cgi-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.