Jump to content

[SOLVED] why do I get the Parse error: "syntax error, unexpected $end "?


shedokan

Recommended Posts

I'm always getting a Parse error: "syntax error, unexpected $end" when I'm opening y php file here is the source code:

 

 

<html>

<body>

<?php

 

$pass = $_POST[pass];

 

if (isset($pass)) {

echo 'You must enter a password:<br><form name="input" action="the_name_of_the_file.php" method="post"><input type="text" name="pass"><input type="submit" value="Submit"></form>';

}

elseif ($pass!=pass) {

echo 'You entered a wrong password:<br><form name="input" action="the_name_of_the_file.php" method="post"><input type="text" name="pass"><input type="submit" value="Submit"></form>';

}

elseif ($pass=="pass") {

 

*/connect to mysql and then coose a database/*

$name = $_POST[name];

 

$link = $_POST[link];

 

$ctg = $_POST[ctg];

 

$img = $_POST;

 

$bg = $_POST[bg];

 

$date = date('Y-m-d');

 

echo 'some form';

 

$insert="some my sql quiery goes here";

 

mysql_query($insert,$db);

?>

</body>

</html>

<html>
<body>
<?php

$pass = $_POST["pass"];

if (!isset($pass)) {

echo "You must enter a password:<br /><form name=\"input\" action=\"the_name_of_the_file.php\" method=\"post\"><input type=\"text\" name=\"pass\"><input type=\"submit\" value=\"Submit\"></form>";

} elseif ($pass != "pass") {

echo "You entered a wrong password:<br /><form name=\"input\" action=\"the_name_of_the_file.php\" method=\"post\"><input type=\"text\" name=\"pass\"><input type=\"submit\" value=\"Submit\"></form>";

} elseif ($pass == "pass") {

// connect to mysql and then coose a database

}

?>
</body>
</html>

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.