Jump to content

hughesa1

New Members
  • Posts

    3
  • Joined

  • Last visited

hughesa1's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have this simple query: $q5 = "select listingid FROM userlisting WHERE userid = '$_SESSION[UserID]'"; $r5 = mysql_query($q5) or die(mysql_error()); $a5 = mysql_fetch_array($r5); The userlisting table is a many to many relationship. It is used as a lookup table. Each userid can be associated with multiple listingids and vice versa. Also in my file (a html template file) I have this code if(!empty($_SESSION[UserID]) and $a5['listingid'] == $_GET['id']) : So I am wanting to check if the listingid column in userlisting table = the id of the page (well, it is a property website and it is the id of the property). As each user can be associated with many listingids I need to be able to check multiple rows. But for some reason it only checks the very first row. In the userlisting table there is the following test entries: userid | listingid 1 1 1 2 So one user associated to two listingids. However, it is acting like this userid is only associated with listingid 1, the very first row. Any solutions?
  2. Fantastic, that was all was needed. Thanks for that. What is password hashing?
  3. <html> <head> <title>Admin Panel</title> <style> body {font-family:verdana; font-size:12; font-weight:bold; color:black; background-color:white} td {font-family:verdana; font-size:12; font-weight:bold; color:black} .style1 { font-size: 12px; font-weight: bold; } </style> </head> <body onLoad="document.f1.username1.focus();"> <!-- main table start here --> <table width=761 height=500 align=center border=0 bordercolor=black cellspacing=0 cellpadding=0> <tr> <td align=center> <!-- second table start here --> <table width="757" border="0" cellspacing="0" cellpadding="0" height="100%" bgcolor=white> <tr> <td align=center> <form method="post" action="login.php" name="f1"> <table align=center width=400 border=0 bordercolor=black cellspacing=0 cellpadding=5> <caption align=center><?=$MyError?></center> <tr bgcolor=#333333> <td colspan=2 align=center bgcolor="#333333"><span class="style1"><font color="#FFFFFF">Site Admin Login </font></span></td> </tr> <tr bgcolor=#77D2FF> <td bgcolor="#FFFFFF">Username: <font size="1"> </font></td> <td bgcolor="#FFFFFF"><input type="text" name="username1" maxlength="20"></td> </tr> <tr bgcolor=#77D2FF> <td bgcolor="#FFFFFF">Password: <font size="1"> </font></td> <td bgcolor="#FFFFFF"><input type="password" name="password1" maxlength="20"></td> </tr> </table> <br> <center> <input type="submit" name="s2" value="Login" style="background-color:#6598CD; font-size:11; color:black; font-family:verdana, arial; font-weight:bold; border-width:1; border-color:#333333"> </center> </form> </table> <!-- second table end here --> </td> </tr> </table> <!-- main table end here --> <? require_once("../conn.php"); if(isset($_POST[s2])) { $MyUsername1 = strip_tags($_POST[username1]); $MyPassword1 = strip_tags($_POST[password1]); if(empty($MyUsername1) || empty($MyPassword1)) { $MyError = "<center><font color=red size=2 face=verdana><b>All fields are required!</b></font></center>"; } else { //check the login info if exists $q1 = "select * from re2_admin where AdminID = '$MyUsername1' and AdminPass = '$MyPassword1' "; $r1 = mysql_query($q1); if(!$r1) { echo mysql_error(); header("Location:error1.php"); exit(); } else { if(mysql_num_rows($r1) == '1') { $a1 = mysql_fetch_array($r1); $_SESSION[AdminID] = $MyUsername1; $_SESSION[AdminEmail] = $a1[AdminEmail]; $_SESSION[AdminName] = $a1[AdminName]; header("location:index.php"); exit(); } } } } ?> I have listed the HTML then the PHP. In the actual file, the PHP comes before the HTML. I have a script I sell over again. I have installed it many times. The script has a 'site admin' backend to manage the site from. The default user and password to login to the script is 'admin.' It works everytime. But I installed it last night for a customer on their host and 'admin' does not work. I checked PHPMyAdmin to see if that was the username/password in there and it is. I would much appreciate your help in solving this. I am guessing the fact that my script is very old has something to do with it.
×
×
  • 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.