any way looking at the code...it shows that you are new to php and trying to edit some script (i think i saw it in zend site)
about script bad news is that it may have suffered even bigger problem as i feel like you have not gone php toturials or books ...as you have not read about main function like isset...
(i am not saying it negatively)
so keep it up but rather than directly editing others codes first read the basics...may be good books ,toturials site...and then may be edit...
here main cause of error seem to be end if
so may be you can do like this
<html>
<head>
<title>The Joke database</title>
</head>
<body>
<?php if (isset($_GET['addjoke'])):
{
?>
<form action="<?echo $_SERVER['PHP_SELF']; ?>" mehod='post'>
<label>Type your joke here:<br />
</textarea></label><br />
<input type="submit" value="SUBMIT" />
</form>
<?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>';
}//close of main if showing form
?>
</body>
</html>
i dont saw much logical things but saw just semantical things
and other bitter truth is you usually get good support for php things here may be try
www.sitepoint.com/forums
and may be i have also written a joke script for foreign client ..if u seriously need it
www.jokes.bestcyberzone.com
not ad as this is not my site...means not owner
enjoy