$_POST in Location

maarian

Erfahrenes Mitglied
Noch ne Frage


wenn ich auf user suchen gehe wird das mti der datei überprüft:
Problem wenn ich jetzt zb test suche bin ich bin test eingeloggt :D

hilfeeeeee

PHP:
<?php
include"inc/config.php";
session_start(); // start the session
if(!isset($_SESSION['user'])){
    // check if the user is logged in
    // the user is not logged in
    header("Location: index.php"); // take him/her to the login page
} else {
    // the user is logged in
    // the page will go in here, e.g.

	
}
?>
<?php
	include "mysql.php";
	$user = addslashes($_POST['usersuche']); // make sure people can't hack the db by entering '" MySQL QUERY HERE as the username
        $userrow = mysql_query("SELECT * FROM `userdb` WHERE `username` = '" . $_POST['usersuche'] . "';",$mysql);
	if(mysql_num_rows($userrow) != "1"){
		// no rows found, wrong password or username
			Header("Location: error.php?user=$user");
	} else {
		// 1 row found exactly, we have the user!
		header("Location: viewprofile.php?name=$user");
	}
?>
 
Zuletzt bearbeitet:
Zurück