繁体   English   中英

使确认页面,然后提交与PHP

[英]make confirm page before submit with php

我制作了一个php表单,我想在发送到数据库之前进行确认,我制作了另一个花药php表单,并回显数据并使用value =“,但是当我使用tinymce时,它不能很好地工作并删除了一些特殊字符。

 <div class="form-group"> <script type="text/javascript" src="js/tinymce/tinymce.min.js"></script> <form action="" method="POST" accept-charset="utf-8" enctype="multipart/form-data"> <label for="usr">تهیه کننده نامه:</label> <input type="text" class="form-control" name="creator" value="" placeholder="تهیه کننده نامه"> <label for="usr">فرستنده نامه</label> <input type="text" class="form-control" name="sender" value="" placeholder="فرستنده نامه"> <label for="usr">گیرنده نامه</label> <input type="text" class="form-control" name="reciver" value="" placeholder="گیرنده نامه"> <label for="usr">موضوع</label> <input type="text" class="form-control" name="subject" value="" placeholder="موضوع"> <label for="usr">رونوشت:</label> <input type="text" class="form-control" name="copywriter" value="" placeholder="رونوشت"> <label for="usr">متن نامه:</label> <script type="text/javascript"> tinymce.init({ selector: 'textarea', plugins: 'directionality', toolbar: 'ltr rtl', toolbar: 'fontselect', font_formats: 'Nazanin= B Nazanin;Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;AkrutiKndPadmini=Akpdmi-n', height: 500, theme: 'modern', plugins: [ 'advlist autolink lists link image charmap print preview hr anchor pagebreak', 'searchreplace wordcount visualblocks visualchars code fullscreen', 'insertdatetime media nonbreaking save table contextmenu directionality', 'template paste textcolor colorpicker textpattern imagetools codesample toc help emoticons hr' ], toolbar1: 'fontselect | fontsizeselect | formatselect | bold italic strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat |ltr rtl', image_advtab: true, templates: [ { title: 'Test template 1', content: 'Test 1' }, { title: 'Test template 2', content: 'Test 2' } ], content_css: [ '//fonts.googleapis.com/css?family=Lato:300,300i,400,400i', '//www.tinymce.com/css/codepen.min.css' ] }); </script> <textarea name="text" rows="20" cols="60" class="form-control"></textarea> <input type="hidden" name="date" value="<?php echo date('Ym-d'); ?>"><br/> <input type="submit" value="ثبت" class="btn btn-primary" name="submit"> </form> 

在这里,我确认php页面:

 <?php $creator = $_POST['creator']; $sender = $_POST['sender']; $reciver = $_POST['reciver']; $subject = $_POST['subject']; $copywriter =$_POST['copywriter']; $text = $_POST['text']; echo "<b>تهیه کننده</b>" . $creator . "<br/>"; echo "<b>فرستنده:</b>" . $sender . "<br/>"; echo "<b>گیرنده:</b> " . $reciver . "<br/>"; echo "<b>موضوع:</b> " . $subject . "<br/>"; echo "<b>رونوشت:</b> " . $copywriter . "<br/>"; echo "<b>متن نامه:</b> " . $text . "<br/>"; ?> <form action="" method="POST" accept-charset="UTF-8" enctype="multipart/form-data"> <input type="hidden" name="var" value="add"> <input type="hidden" name="creator" value="<?php echo $creator;?>"> <input type="hidden" name="sender" value="<?php echo $sender;?>"> <input type="hidden" name="reciver" value="<?php echo $reciver;?>"> <input type="hidden" name="subject" value="<?php echo $subject;?>"> <input type="hidden" name="copywriter" value="<?php echo $copywriter;?>"> <textarea name="text" rows="20" cols="60" class="form-control" value="<?php echo $text;?>"></textarea> <label for="usr">پیوست نامه</label> <input type="file" class="form-control" name="fileToUpload" id="fileToUpload" > <input type="submit" value="ثبت نهایی" class="btn btn-primary" name="submitfinal"> </form> 

主要问题是在Textarea中,它无法正确处理表单,它显示了一些数据,但是当用户最终提交时,它不会发送所有字符,例如

到数据库。

尝试使用更改选择器

tinymce.init({
    selector: '.textarea', -- .textarea

并把课放在textarea上

<textarea name="text" rows="20" cols="60" class="form-control text-area"></textarea>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM