Jump to content

Archived

This topic is now archived and is closed to further replies.

amazingpatel

Need help with PHP Form please.

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.

Share this post


Link to post
Share on other sites
u need to paste your code.  this doesn't sound right so we need to see where your code is messed up.

Share this post


Link to post
Share on other sites
It would also help to see the code the user is pasting into the form.

Share this post


Link to post
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"); ?>

Share this post


Link to post
Share on other sites
Does anybody know why a user can type a joke into the form but not copy and paste a joke into the form?
If a joke is pasted into the form it somehow is enetered as blank.

Share this post


Link to post
Share on other sites

×

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.