Jump to content

Need help with PHP Form please.


amazingpatel

Recommended Posts

Hello,

      I have a form on a webpage, when a user types something into the form and clicks submit the users comments are passed through to the mysql db, but when a user copies and pastes text into the form the data is not passed through to the mysql db.
Any help or advice would be much appericated.
Thanks in advance.
Link to comment
Share on other sites

Hello,
      Here is the code:

<?php include("jheader.php"); ?>

<table cellpadding=1 border=0 cellspacing=0 width=458>

<tr>

<td bgcolor=<?php printf($sitecolor); ?> align=center>

<font size="3" face="Arial, Helvetica, sans-serif"><b>Add
Joke</b></font><br>

<table bgcolor=#CECECE cellpadding=1 border=0 cellspacing=0 width=100%>

<tr>

<td align=center>

<FONT SIZE=2>

<center>

<?php

if (logincheck($uid, $upwd)) {

?>





<form enctype="multipart/form-data" action=savejoke.php method=post>

<table cellpadding=5 cellspacing=0>

<tr>

<th colspan=2><font size=2 face='Arial, Helvetica, sans-serif'>Enter the
title for your Joke</font></th>

</tr>

<tr>

<td colspan=2 align=center><input type=text name=joketitle size=60></td>

</tr>

<tr>

<th colspan=2><font size=2 face='Arial'>Enter the Joke</font></th>

</tr>

<tr>

<td colspan=2><textarea name=joke rows=20 cols=50></textarea>

</tr>



<tr>

<th colspan=2><font size=2 face='Arial'>Select a Categories</font></th>

</tr>

<tr><td colspan=2>

<?php

$sql = "select * from categories order by category";

$result = mysql_query($sql ,$db);

$newrowcount = 0;

printf("<table><tr>");

if ($myrow = mysql_fetch_array($result)) {

do {

if ($newrowcount == 4) {

$newrowcount = 0;

printf("</tr>");

printf("<tr>");

}

printf("<td><font size=2 face='Arial'><input type=radio name=catid value=%s>
%s</font></td>", $myrow["catid"], $myrow["category"]);

$newrowcount++;

} while ($myrow = mysql_fetch_array($result));

}

for ($c = $newrowcount; $c < 4; $c++) {

printf("<td></td>");

}

printf("</tr></table>");

?>

</td></tr>

<tr>

<td colspan=2 align=middle>

<br>

<input type=reset value=Reset>

   

<input type=submit value=Submit>

</td>

</tr>

</table>

</form>

<?php

} else {

printf("<font size=2 face='Arial'><br>You need to be logged in before you
can add a joke</font>");

}

?>

</center>

</FONT>



</td>

</tr>

</table>

</td>

</tr>

</table>



<?php include("jfooter.php"); ?>
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.