簡體   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