dph19153 2013-11-29 18:59
浏览 64

表单上的TextArea最多只能占用50个字符?

When a user tries to enter a review in "textarea" in the form, only 50 characters of review is displayed. I have tried resolving the situation by disabling Jquery form validation changing the field type to tinytext, mediumtext. I am able to enter the full review 200 characters via PHPMyAdmin so I am guessing the problem is with my PHP but I am not able to see anything obvious . If any one could help it would be greatly appreciated.

    <label for="review">Your Review</label>
    <br/>
    <textarea name="review" id="review" rows="15" cols="60"></textarea>


     // Check for a review
if (empty($_POST['review'])){
    $errors[] = "Please write a review";
} else {
    $review = (trim($_POST['review']));
} 


if (empty($errors)) { // If no errors were found.

    require_once('./includes/mysql_connect.php');

    // Make the insert query.
    $query = "INSERT INTO films (movie_title, actor, rating, user_id)
    Values ('$mt', '$la', '$rating', '$user')";

    $result = mysql_query($query);

    $id = mysql_insert_id();

    $query = "INSERT INTO reviewed (review, movie_id)
    values ('$review', '$id')";

    $result = mysql_query($query);



    <div id="Review_container">

    <?php
    require_once('./includes/mysql_connect.php');
    $review = $_GET['id'];
    echo $review;
    ?>
    </div>




 Table structure for table `reviewed`


 CREATE TABLE IF NOT EXISTS `reviewed` (
 `review_id` int(4) NOT NULL AUTO_INCREMENT,
 `review` mediumtext NOT NULL,
 `movie_id` int(4) NOT NULL,
 PRIMARY KEY (`review_id`),
 KEY `movie_id` (`movie_id`)
 ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;


  //No value for review
    if ($('#review').val() == "") {
        $('.error').append("<li>Please enter a review</li>");
        error = true;
    }

    if (error) { // If error found dont submit.
        e.preventDefault();
    }
   }); // End of .submit function: review_a_film.php
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度
    • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
    • ¥15 ETLCloud 处理json多层级问题
    • ¥15 matlab中使用gurobi时报错
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭
    • ¥15 2020长安杯与连接网探
    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么