Page 2 of 2

Re: Video 9

Posted: Mon Aug 10, 2009 7:46 pm
by SpiritWebb
hallsofvallhalla wrote:are you converting your password on log in to md5 also?
Yes...I didn't change anything. The first account I created, works. When I had my wife try it, the register now works (displays race chosen in the db), but when logging in, it says wrong username or password.

authenticate.php

Code: Select all

 <link href="style.css" rel="stylesheet" type="text/css" />
<STYLE type="text/css">
 <!--
 BODY { background-image:url(loginClear.png);
               background-repeat:no-repeat;
               background-position:center;
               background-attachment:fixed }
 -->
</STYLE>

<body bgcolor="black">
<body text="white">
<div id="successfull">
    <?php
    include_once 'connect.php';
    session_start();

    if (isset($_POST['submit']))
    {
      $player=$_POST['player'];
      $password=$_POST['password'];
      $player=strip_tags($player);
      $password=strip_tags($password);
      $password=md5($password);


      $query = "select name,password from players where name='$player' and '$password'";
      $result = mysql_query($query) or die("Could not query players");
      $result2 = mysql_fetch_array($result);
      if ($result2)
      {
        /* adding last login */

      /*end last login */
        $_SESSION['player']=$player;


sleep(4);
      header("Location: http://localhost/mythuto/index.php"); /* Redirect browser */

      }
      else
      {
       echo "<A href='login.php'>Back to login</a>";
      }
    }
    ?>
    </div>
    </body>
    </body>

Re: Video 9

Posted: Mon Aug 10, 2009 7:53 pm
by hallsofvallhalla

Code: Select all

sleep(4);
      header("Location: http://localhost/mythuto/index.php"); /* Redirect browser */
what is that garbage?

use

Code: Select all

header("Refresh: 2; url=http://localhost/mythuto/index.php");

THIS MUST be placed at top of page just below include connect and session_start, which needs to be moved above the html

no output must be before it.

Re: Video 9

Posted: Mon Aug 10, 2009 8:02 pm
by SpiritWebb
Even changing that bit...(which worked before) it still doesn't work for the other account

Re: Video 9

Posted: Mon Aug 10, 2009 8:11 pm
by Torniquet
could it be due to this....

$query = "select name,password from players where name='$player' and '$password'";

im sure you need to tell it where to look for the password :s

$query = "select name,password from players where name='$player' and password='$password'";

Re: Video 9

Posted: Mon Aug 10, 2009 9:07 pm
by SpiritWebb
Torniquet wrote:could it be due to this....

$query = "select name,password from players where name='$player' and '$password'";

im sure you need to tell it where to look for the password :s

$query = "select name,password from players where name='$player' and password='$password'";
I tried a different name, anothere "fake" account, just to test it. And that one worked fine. Just the one my wife created doesn't seem to work. But I will try this method tonight when I get home from work, and let you know.

Re: Video 9

Posted: Mon Aug 10, 2009 10:00 pm
by Torniquet
ah ok i get ya lol. I know i had this trouble at one point... but cant remember the reason behind it lol.

if i remember before you fix it. ill let ya knows.



offtopic...

background-attachment:fixed << is that to keep the background static when your scrolling?

Re: Video 9

Posted: Mon Aug 10, 2009 10:47 pm
by SpiritWebb
Torniquet wrote:
background-attachment:fixed << is that to keep the background static when your scrolling?
Yes

Code: Select all

BODY { background-image:url(loginClear.png);  ///specific image set for background ///
               background-repeat:no-repeat;  ///Keeps the image from repeating ///
               background-position:center;  /// positions the image ///
               background-attachment:fixed }  ///keeps the background static, while scrolling the text. ///
Put that in there, so some people might know what it means. :P

Re: Video 9

Posted: Tue Aug 11, 2009 6:45 am
by SpiritWebb
Torniquet wrote:
$query = "select name,password from players where name='$player' and password='$password'";
I tried what you suggested, and it worked. I don't know why it worked with the others, and not one. But hey, it works now...thanks!