View Single Post
Old Apr 18, 2012, 11:35 AM   #10
Akumos
200 Posts
 
Akumos's Avatar
 
Join Date: Nov 2008
Location: Birmingham, England...
Posts: 479 (0.29/day)
Thanks: 75
Thanked 27 Times in 22 Posts

System Specs

It's nothing important... The only wasy I know how to test is save it from dreamweaver, upload it using filezilla, then navigate to the url!

In the end, I went for this code... Can anyone tell me (using the same SIMPLE ways i'm using) where and how I would get the password submitted from part1.html and compare it to the username?

Thanks

PHP Code:
<?
    $dbServer=mysql_connect ("localhost","admin","pw");
    if (!$dbServer) {echo "Failed to connect to MySQL"; exit; }
    
    mysql_select_db("a3484399_ps",$dbServer);
    
    $sql ="SELECT * FROM users";
    $sql.=" WHERE fName=\"".$_POST["searchName"]."\"";  // the space before the WHERE is critical
    
    
    $queryResult=mysql_query($sql);
    
    if (mysql_error())
    {
      echo "Problem with Query<BR>";
      echo "The following error message was returned from MySQL:<BR>";
      echo mysql_error();
      exit;
    }
    
    if (mysql_num_rows($queryResult)==0)
    {
      echo "No users with that name.";
    }
    else
    {
      while ($dbRecord=mysql_fetch_array($queryResult))
      {
        echo "Welcome ".$dbRecord["fName"]."<BR>";
                
        
      }
    }
    
    
    
 ?>
__________________

Last edited by Tatty_One; Apr 18, 2012 at 12:16 PM. Reason: Triple post madness! Keep it tidy
Akumos is offline  
Reply With Quote