I've been readint he tutorial y'all have on this site...it's great.

Anyway, to "learn" this stuff, I try tinkering with scripts, but it won't work for some reason. It displays the jokes, but for some reason, when I tell it to add a joke, it won't. Here's the code I've been trying to use. (Can someone also explain to me how 'if("ADD" == $submitjoke){' is supposed to work...I don't understand how that is triggered when the user clicks on the button and submits the form .... maybe I M just to used to JavaScript, but I want to UNDERSTAND the language, so please help. (since it displays the info fromt he database, I know that it is connecting.)

<html>
<head>
<title>Today's Date</title>
</head>
<body>
<?php

$dbcnx = @mysql_connect("localhost","root","");

mysql_select_db("jokes");

?>
<h1>Add a Joke:</h1><br>
<form method="post" action="<?php echo($PHP_SELF);?>">
<textarea name="JokeText">Type your joke here:</textarea><br>
<input type="submit" name="submitjoke" value="ADD">
</form><br><Br>
<?php

if("ADD" == $submitjoke){
$sql="INSERT INTO Jokes SET".
"JokeText='JokeText', ".
"JokeDate=CURDATE()";
}

mysql_query($sql)

?>
<h1>Jokes thus far:</h1>
<?php
$jokes = mysql_query("SELECT JokeText FROM Jokes");

while ($row=mysql_fetch_array($jokes)){
echo("<P>" . $row["JokeText"]."</p>");
}

?>
</body>
</html>