Unexpected T_STRING

Hello,

I am currently learning how to make a login system, and I am getting an Unexpected T_STRING. Here are the lines where I’m getting it.


session_start(); //Starts the session 
print "<div style="display:none;">";//Makes it so the error in the connect file doesnt show, we already know the table users is not created yet!
require ("connect.php"); //Makes sure we are connected to the database
print "</div>"; //End div
if ($_SESSION['admin'] != "verified"){ //If the session isn't set
	print "<h1>Welcome to the installer for the user system</h1>"; //Shows the welcome message in a heading	
	print "<form method="post">"; //Starts the form, make sure you slash out the quotation marks, otherwise the string will end and cause an error!
		print "<strong>Username</strong><br />
	<input type="text" name="username" /><br /><br />"; //The username entry for the login	
	print "<strong>Password</strong><br />
	<input type="password" name="pass" /><br /><br />"; //Password entry for the login
	print "<input type="submit" name="login" value="Login!" />"; //Submits the form	
	print "</form>"; //Ends the form

}

i am getting on line 2 and on line 7. Any ideas?

Thanks,
Bobby

Look how does forum highlight it for you.
Don’t you see something unusual with display:none?
You’ve got to know basic PHP syntax.
This page will be mighty helpful for you: http://php.net/types.string

boboreo, lets take line two as an example:

print "<div style="display:none;">"

PHP will start at the first " in that line and output as HTML everything until it reaches an unescaped " in the line, in the case of the above line as far as php is concerned the end of what you want output is right after the style= but before the display: and so so it is not expecting to find a string afterwards, it expects to find either the concatenation orperator

.

or a ; to mark the end of the line.

The correct form for that line would be:

print "<div style='display:none;'>"

HTH

(just to be a wise***)
Or

print "<div style=\\"display:none;\\">";

Or

print '<div style="display:none;">';

Or

print '<div style=\\'display:none;\\'>';