开发者

copy and paste on textarea won't work on mysql

开发者 https://www.devze.com 2023-02-21 05:03 出处:网络
if i copy a text paragraph and paste it on a textarea for an update content my mysql database won\'t update the content but when i type it manually on the textarea, the mysql database will then be upd

if i copy a text paragraph and paste it on a textarea for an update content my mysql database won't update the content but when i type it manually on the textarea, the mysql database will then be update the content..how can i update the content in the mysql using copy and paste method

 if (isset($_POST['submit'])) {
$main = $_POST['main'];

$result = mysql_query("UPDATE tbl_content SET main ='$main' WHERE users = '$name' 

}

<textarea name="mep" id="mep" rows="3" cols="50"></texta开发者_如何学Gorea>
<input type="submit" name="submit" id="button" value="Submit" />


Textarea is named mep not main.

$main = $_POST['mep'];

Please provide more information. And that C/P thing doesn't make sense, it should work.


Try with:

 $main = mysql_real_escape_string($_POST['main']);

ah, and what @webarto said.

0

精彩评论

暂无评论...
验证码 换一张
取 消