Re: Video#5
Posted: Fri Jan 14, 2011 9:00 pm
				
				I really love your tutorials  
 
I haven't had much knowledge about php before but I managed to set up a registration and a login, but the login doesn't work.
I get this error message:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\MDR\lay\index.php:18) in C:\xampp\htdocs\MDR\lay\includes\authenticate.inc.php on line 2
Logged in successfully
Continue
Here my codes
Login
authenticate
The problem is that I use a layout where I have to change the links. Maybe this is why it doesn't work? Because it loggs me in sucessfully but there also is a error message. In my code "player" is named "name" and my database is "user".
I hope someone can help me. I just can't figure out were I went wrong.
Thank you very much!
			 
 I haven't had much knowledge about php before but I managed to set up a registration and a login, but the login doesn't work.
I get this error message:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\MDR\lay\index.php:18) in C:\xampp\htdocs\MDR\lay\includes\authenticate.inc.php on line 2
Logged in successfully
Continue
Here my codes
Login
Code: Select all
<form method="POST" action="index.php?site=authenticate">
Nickname: <input type="text" name="name" size="21"><br>
Passwort: <input type="password" name="password" size="21">
<br>
<input type="submit" value="Login" name="submit">Code: Select all
<?php
session_start();
include_once 'connect.php';
if (isset($_POST['submit']))
{
  $name=$_POST['name'];
  $password=$_POST['password'];
  $name=strip_tags($name);
  $password=strip_tags($password);
  $password=md5($password);
  $query = "select name,password from user where name='$name' and password='$password'";
  $result = mysql_query($query) or die("Could not query players");
  $result2 = mysql_fetch_array($result);
  if ($result2)
  {
    $_SESSION['name']=$name;
   
    echo "<big>Logged in successfully<br>";
    echo "<A href='index.php?site=startseite'>Continue</a></big>";
  }
  else
  {
   echo "<big>Wrong username or password.<A href='index.php?site=login'>Try Again</a></big>";
  }
}
?>I hope someone can help me. I just can't figure out were I went wrong.
Thank you very much!
 
 