Gamerz Posted August 5, 2009 Share Posted August 5, 2009 How do I get the following to work? I want to match the folder name and the username, and if they both match, the server will continue on with the script...and if one does not match, like the username and foldername is a different name, the server will require_once a login page, and exit; so the script dies. Here's the snippet of the code: <?php $current_folder = basename(dirname(__FILE__)); if ($qls->user_info['username'] && $current_folder ==$qls->user_info['username']) { } else { require_once('login.php'); exit; } ?> I want to make the iff, && statement to work..did I do everything work on the code, line 3? (Especially the "&& $current_folder code, because I know it doesn't work...) Link to comment https://forums.phpfreaks.com/topic/168882-solved-php-if/ Share on other sites More sharing options...
Gamerz Posted August 5, 2009 Author Share Posted August 5, 2009 NVM!! I solved the problem! For line three, ($current_folder ==$qls) I forgot to add a space between the == and $qls! Problem Solved. Link to comment https://forums.phpfreaks.com/topic/168882-solved-php-if/#findComment-891028 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.