require("connection.php"); require("session.php"); // Om man vill logga in if($_GET[tfUser]){ $kundweb = $_GET[kundweb]; if($kundweb==true){ $user = $_GET[tfUser]; $password = $_GET[tfPassword]; } else{ Header("Location:index.php?attack=true"); exit; } } else if($_POST[tfUser]){ $user = $_POST[tfUser]; $password = $_POST[tfPassword]; } if($user!="" && strlen($password)>6){ $user = str_replace("\\", "", $user); $user = str_replace("'", "", $user); $user = str_replace("\"", "", $user); $user = str_replace("/", "", $user); $user = str_replace("#", "", $user); $user = mysql_real_escape_string($user); $password = str_replace("\\", "", $password); $password = str_replace("'", "", $password); $password = str_replace("\"", "", $password); $password = str_replace("/", "", $password); $password = str_replace("#", "", $password); $password = mysql_real_escape_string($password); $password = md5($gSalt.$password); $sql = "select * from kund where user='$user' and pass='$password'"; $rs = runSql($sql); if($rs->_NumOfRows>0) { //Uppdatera räknare $kundnr = $rs->Fields['kundnr']; $company = $rs->Fields['company']; $kundweb = $rs->Fields['kundweb']; constructSession($kundnr, $company, $kundweb); //addLogg($kundnr, $company); Header("Location:$kundnr/main.php?$UID"); } } ?>
