Hej, jag får ett felmeddelande jag inte riktig verkar luska ut vart detta [ finns någonstans, var dock ett tag sen jag kodade, men jag kan verkligen inte hitta?
<?php session_start();
include "_include/connection.php";
include "_include/functions.php";
$do = $_GET["do"];
if($do == "login"){
login($_POST['user'],$_POST['pincode'],$_POST['bil']);
}
?>
functions.php
<?php
function login($user,$pincode,$bil){
$query = mysql_query("SELECT id from korjournal_users where user = '".$user."' and pincode = '".$pincode."'");
$result = mysql_fetch_array($query);
$count=mysql_num_rows($query);
$returnthis = "";
if($count == 1){
$_SESSION['online'] = "1";
session_register("online");
$_SESSION['user'] = $result["id"];
session_register("user");
$_SESSION['bil'] = $bil;
session_register("bil");
$returnthis = "<script>self.location='?do=home';</script>";
} else {
$errormsg = "Fel Användare/Lösen!";
$returnthis = "<script>self.location='?user=".$user."&bil=".$bil."&errormsg=".$errormsg."';</script>";
}
return ($returnthis);
}
function add_journal($bil,$user,$start,$stop,$extra1,$extra2,$extra3){
$date = date("Y-m-d",strtotime("+2 hour"));
$date_time = date("Y-m-d H:i:s",strtotime("+2 hour"));
$insert_row = "INSERT INTO korjournal (bil_id,date,date_time,user_id,start,stop,extra1,extra2,extra3) VALUES ('".$bil."','".$date."','".$date_time."','".$user."','".$start."','".$stop."','".$extra1."','".$extra2."','".$extra3."')";
mysql_query($insert_row);
mysql_query("UPDATE korjournal_bil SET matarstallning='".$stop."' WHERE id='".$bil."'");
$returnthis = "<script>self.location='?do=home';</script>";
return ($returnthis);
}
?>