error

i keep getting this error code
can someone plz help me??

Parse error: syntax error, unexpected ‘’ (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:\xampp\htdocs\login.php on line 10

[php]if(!empty($_post)) {

include_once(“inc/connstring.php”);
$table=“admin”;

$username = isset($_POST[‘username’]) ? $_POST[‘usernamn’] : ‘’;
$password = isset($_POST[‘password’]) ? $_POST[‘password’] : ‘’;
}[/php]

it’s $_POST not $_post, plus only seeing a partial code I highly doubt that it’s going to work.

here’s a partial snippet of my code, the thing I am trying to point out to you is the first line:

[php]if (isset($_POST[‘action’]) && $_POST[‘action’] == ‘submit’) {

$character = new Registration();
$errorMsg  = NULL;

$data['username']  = trim($_POST['username']); // Required	
$password          = trim($_POST['pass']);
$passOK            = $character->isPassWordStrong($password);

if ($passOK) {
	$errorMsg     = '<li class="stop-bullet">Password must be at least 8 characters, </li><li class="stop-bullet">and must contain at least one lower case letter, </li><li class="stop-bullet">one upper case letter and one digit</li>';
} else {	
	$data['pass']      = password_hash($password, PASSWORD_BCRYPT, array("cost" => 15));
}
$password           = NULL;	

$data['email']      = trim($_POST['email']); // Required
$data['school']     = $_POST['school'];
$data['gradeLevel'] = $_POST['gradeLevel'];
$data['gender']     = $_POST['gender'];
$data['stereoType'] = $_POST['stereoType'];[/php]

I use a hidden field along with a submit button:

<input type="hidden" name="action" value="submit" />  

Also misspelled username, and where’s line 10? because I don’t see 10 lines up there.

Sponsor our Newsletter | Privacy Policy | Terms of Service