Changing login script to multiple user names and passwords

Hi all. I currently have this code on my site:

<?php set_time_limit(0); include('includes/common.php'); $msg=""; if(isset($_POST['submit'])) { $uname1 = $_POST['uname']; $pass1 = $_POST['pass']; if(($uname1=="exchange2011") && ($pass1=="epadhaisvital")) { $_SESSION['login']="LOGGEDIN"; header("Location:profile_2012.php"); exit(); } else { $msg='Invalid Login!'; } } ?>

I just need to add an additional Username and Password. Both users will get access to the same pages. Thoughts? Thanks in advance.

Cheers.

This would be better using MySQL but for your version goto this line:

[php]
if(($uname1==“exchange2011”) && ($pass1==“epadhaisvital”))
[/php]

and change it to
[php]
if(($uname1==“exchange2011”) && ($pass1==“epadhaisvital”)) || (($uname1 == “somethingelse”) && ($pass1 == “somethingelse”))
[/php]

Also I’ve locked your other topic since it was a duplicate post.

Sponsor our Newsletter | Privacy Policy | Terms of Service