Jump to content

[SOLVED] why do i get this error


madspof

Recommended Posts

Hi everyone i am getting this php error "Parse error: syntax error, unexpected '}' in /www/110mb.com/i/m/p/a/c/t/-/y/impact-ye/htdocs/Login.php on line 16"

 

I am quite an expericenced php user but i cannot see why i am getting this, its probaly somthing that is realy easy to fix but i cannot see it can anyone see why.

 

<?php
$cookie_data="random";
$user = $_POST['name'];
$pass = $_POST['pass'];
if( $user == "staff"){
if($pass == "password"){
$log = "you are now logged in";
setcookie ("cookie_info",$cookie_data, $time+1800)
}else
        { echo "your password is wrong";}
}
else{
$log = "you are mot logged in";
}

?>

Link to comment
https://forums.phpfreaks.com/topic/78410-solved-why-do-i-get-this-error/
Share on other sites

Your missing the closing ; on the setcookie line.

 

<?php

  $cookie_data="random";
  $user = $_POST['name'];
  $pass = $_POST['pass'];
  if($user == "staff") {
    if ($pass == "password") {
      $log = "you are now logged in";
      setcookie ("cookie_info",$cookie_data, $time+1800);
    } else {
      echo "your password is wrong";
    }
  } else {
    $log = "you are mot logged in";
  }

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.