Jump to content


Photo

Need help with PHP Form please.


  • Please log in to reply
6 replies to this topic

#1 amazingpatel

amazingpatel
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 05 October 2006 - 04:06 PM

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.


#2 thepip3r

thepip3r
  • Members
  • PipPipPip
  • Advanced Member
  • 289 posts

Posted 05 October 2006 - 04:08 PM

u need to paste your code.  this doesn't sound right so we need to see where your code is messed up.

#3 roopurt18

roopurt18
  • Staff Alumni
  • Advanced Member
  • 3,749 posts
  • LocationCalifornia, southern

Posted 05 October 2006 - 04:09 PM

It would also help to see the code the user is pasting into the form.
PHP Forms : Part I | Part II

JavaScript: Singleton

http://www.rbredlau.com

#4 amazingpatel

amazingpatel
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 05 October 2006 - 04:12 PM

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


#5 amazingpatel

amazingpatel
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 05 October 2006 - 04:13 PM

The user is posting a joke.
It works when they type it in, it doesn't work when they copy and paste.


#6 amazingpatel

amazingpatel
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 06 October 2006 - 02:33 PM

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.


#7 amazingpatel

amazingpatel
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 10 October 2006 - 05:51 PM

*bump*

Does anybody have any ideas?





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users