[php html] Help please
Posted: Wed Feb 02, 2011 4:41 am
hey guys i need some help here ive been stumped with this issue for abit now and i cant seem to find the problem when i go to my localhost/vpets/login.php and login the address bar comes up at this localhost/vpets/login.php/authenticate.php and it does nothing. You can try it yourself here >http://99.250.196.77/vpets/index.php< but youll have to register first. ill post my codes down below.
authenticate.php
login.php
authenticate.php
Code: Select all
<?php
include "connect.php";
session_start();
header("Refresh: 2; url='index.php'");
?>
<?php
if (isset($_POST['submit']))
{
$player=$_POST['player'];
$password=$_POST['password'];
$player=strip_tags($player);
$password=md5($password);
$query = "select name,password,location from players where name='$player' and password='$password'";
$result = mysql_query($query) or die("Could not conect to database") ;
$result2=mysql_fetch_array($result);
if($result2)
{
$_SESSION['player']=$player;
//$locale = $result2[location];
echo "<center><big>Logged in successfully<br><br>";
echo "Re-directing you to your location<br><br>";
}
else
{
print "Wrong username or password or non-activated account.<A href='login.php'>Try Again</a>";
}
}
?>
login.php
Code: Select all
<?php
include 'connect.php';
session_start();
?>
<!--style
<link href="style.css" rel="stylesheet" type="text/css" />
-->
<div id="logo"><img src="images/logo.jpg" width="500" height="120" /></div>
<div id="logintable">
<form method="POST" action="authenticate.php">
<p> </p>
<p align="center">User Name <input type="text" name="player" size="15">
<br>
Password <input type="password" name="password" size="15" mask="x">
<br>
<input type="submit" value="submit" name="submit">
<br>
<br>
Not registered? Please <A href='register.php'>Register</a><br>
<br>
Forgot password? <A href="getpass.php">Get Password</a><br>
<br>
<p align="center"><br>
<a href="/forums/">Forums.</a></p>
</p>
</form>
</html>
</div>