JhonCena
Journeyman
Plzzz solve this php problem:
Error:
Solve this prob plzzz
Code:
<html>
<head>
<title>The Joke database</title>
</head>
<body>
<?php if (isses($_GET['addjoke'])):
?>
<form action="<?echo $_SERVER['PHP_SELF']; ?>" mehod='post'>
<label>Type your joke here:<br />
</textarea></label><br />
<input type="submit" value="SUBMIT" />
</forum>
<?php
else:$dbcnx = @mysql_connect('localhost', 'root', '********');
if (!dbcnx) {
exit('<p>Unable to connect to the ' .
'database server at this time.</p>');
}
if (!@mysql_select_db('ijdb')) {
exit('<p>Unable</p>');
}
if (isset($_POST['joke'])) {
$joke = $_POST['joke'];
$sql = "INSERT INTO joke SET
joke='$joke',
jokesate=CURDATE()";
if (mysql_query($sql)) {
echo '<p>Your joke has been added. </p>';
} else {
echo '<p>EROR adding submitted joke ' .
mysql_eror() . '</p>';
}
echo '<p>Here are all the jokes in our database.</p>';
$result = @mysql_query('SELECT joke FROM joke');
if (!result) {
exit('<p>Eror</p>');
}
while ($row = mysql_fetch_array($result)) {
echo '<p>' . $row['joke'] . '</p>';
}
echo '<p><a href="' . $_SERVER['PHP_SELF'] .
'?addjoke=1">Add a Joke!</a></p>';
endif;
?>
</body>
</html>
Error:
Code:
Parse error: parse error, unexpected T_ENDIF in C:\Program Files\VertrigoServ\www\tutorial\jokes.php on line 53
Solve this prob plzzz