help desparete 2!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Locked
lisawebs
Forum Commoner
Posts: 44
Joined: Wed Nov 19, 2003 6:21 pm

help desparete 2!!

Post by lisawebs »

I changed the variables, but now there's a new error:

Parse error: expecting T_STRING, T_VARIABLE or T_NUM_STRING
on line 47

---------------------------------------------
<html><head><title>PHP_test</title>
</head>
<body>

<?php
$dbcnx = @mysql_connect("localhost");
if (!$dbcnx) {
echo( "<P>Unable to connect to the " .
"database server at this time.</P>" ); exit(); }

if (! @mysql_select_db("jokes") ) {
echo( "<P>Unable to locate the joke " .
"database at this time.</P>" ); exit(); }
?>

<FORM ACTION="<?php echo($PHP_SELF); ?>" METHOD=POST>
<P>Type your joke here:<BR>
<TEXTAREA NAME="joketext" ROWS=10 COLS=40 WRAP></TEXTAREA>
<BR><INPUT TYPE=SUBMIT NAME="submitjoke" VALUE="SUBMIT">
</FORM>


<?php
if ("SUBMIT" == $_POST['submitjoke']) {
$sql = "UPDATE Jokes SET " .
"JokeDate=CURDATE() , " .
"JokeText=$_POST['joketext'] " ;

if (mysql_query($sql)) {
echo("<P>Your joke has been added.</P>");
} else {
echo("<P>Error adding submitted joke: " .
mysql_error() . "</P>"); }
}

?>

</body>
</html>
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

lisa, not to be rude ( so don't get me wrong ), but you already have a post open, so use the same thread when you have reoccuring problems :P

anyways, i posted a fix for your code in your last thread as well.

viewtopic.php?p=70739#70739
Locked