Advertisement
Zakaln

Untitled

May 28th, 2014
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>TinyEditor - JavaScript WYSIWYG Editor</title>
  6. <link rel="stylesheet" href="tinyeditor.css">
  7. <script src="tiny.editor.packed.js"></script>
  8. </head>
  9. <body>
  10. <form id="form1" method="post" action="index.php">
  11. <textarea name="tinyeditor" id="tinyeditor" style="width: 400px; height: 200px"></textarea>
  12. <input name="Submit" type="submit" Value="envoyer" />
  13. </form>
  14. <script>
  15. var editor = new TINY.editor.edit('editor', {
  16. id: 'tinyeditor',
  17. width: 584,
  18. height: 175,
  19. cssclass: 'tinyeditor',
  20. controlclass: 'tinyeditor-control',
  21. rowclass: 'tinyeditor-header',
  22. dividerclass: 'tinyeditor-divider',
  23. controls: ['bold', 'italic', 'underline', 'strikethrough', '|', 'subscript', 'superscript', '|',
  24. 'orderedlist', 'unorderedlist', '|', 'outdent', 'indent', '|', 'leftalign',
  25. 'centeralign', 'rightalign', 'blockjustify', '|', 'unformat', '|', 'undo', 'redo', 'n',
  26. 'font', 'size', 'style', '|', 'image', 'hr', 'link', 'unlink', '|', 'print'],
  27. footer: true,
  28. fonts: ['Verdana','Arial','Georgia','Trebuchet MS'],
  29. xhtml: true,
  30. cssfile: 'custom.css',
  31. bodyid: 'editor',
  32. footerclass: 'tinyeditor-footer',
  33. toggle: {text: 'source', activetext: 'wysiwyg', cssclass: 'toggle'},
  34. resize: {cssclass: 'resize'}
  35. });
  36. </script>
  37. </body>
  38. </html>
  39. <?php
  40. include ('../escodeve22/connexion/connexion.php');
  41. if (isset($_POST['tinyeditor']))
  42. {
  43. $annonce=$_POST['tinyeditor'];
  44. $annonce=addslashes($annonce);
  45.  
  46. $insert=mysql_query("INSERT INTO `annonce`(`id_annonce`, `login_admin`, `titre`, `annonce`) VALUES ('','Nabil','hh','$annonce')") or die ('dfgdgdfgfd') ;
  47. if($insert) {
  48. echo"<script language='javaScript'>
  49. alert('Annonce ajoutée. !');
  50. </script>" ;
  51. }
  52. else echo '<span class="error">Erreur. </span>';
  53.  
  54. }
  55. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement