We help IT Professionals succeed at work.
Get Started

login through switch only working for default

peps03
peps03 asked
on
332 Views
Last Modified: 2012-05-11
Hi

I have a simple 1 page cms for editing some text on small websites. i am adding a multiple user function.
the correct user with it's credentials is chosen through the url:
index.php?user=home

it works correct, except for this part:

$ppp = md5($password);
            define('SMC_PASS', $ppp);

SMC_PASS is for a login for a sitemap page i put in an iframe. i can log in correctly to the sitemap in the iframe with the default or "else" credentials but not with the home or start passwords.
(= only password protected)

why could this be?
the rest works well, i can login to the cms page with all 3 cases.. only the sitemap pass (SMC_PASS) doesn't login for case home and start.

thanks
<?

if(!empty($_GET['user']))
	{
		switch($_GET['user'])
		{
		case "home":
			$username23 = "home"; //
			$password = "home"; //
			define ("USERN", $username23);
		break;
		
		case "start":
			$username23 = "start"; // 
			$password = "start"; //
			define ("USERN", $username23);
		break;
	
		default:
			$usernameadmin = "peps"; //
			$password = "peps"; //
			define ("USERN", $usernameadmin); //
			$username23 = "";
			break;
		}
	}
else 
	{
	$usernameadmin = "peps"; //
	$password = "peps"; //
	define ("USERN", $usernameadmin); //
	$username23 = "";
	}
	
//Site password
	define ("PASSW", $password);
	
	$ppp = md5($password);
		define('SMC_PASS', $ppp);
	?>

Open in new window

Comment
Watch Question
Most Valuable Expert 2011
Author of the Year 2014
Commented:
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE