This
$sql = "INSERT INTO Jokes SET " .
"JokeText = $joketext, " .
"JokeDate = CURDATE()";
will not work.
SET is normally used to UPDATE data, not to insert.
$joketext must be surrounded by single-quotes as it is a string
So it should go like
$sql = "INSERT INTO...