Jump to content

[SOLVED] PHP if, $$


Gamerz

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.