Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>TinyEditor - JavaScript WYSIWYG Editor</title>
- <link rel="stylesheet" href="tinyeditor.css">
- <script src="tiny.editor.packed.js"></script>
- </head>
- <body>
- <form id="form1" method="post" action="index.php">
- <textarea name="tinyeditor" id="tinyeditor" style="width: 400px; height: 200px"></textarea>
- <input name="Submit" type="submit" Value="envoyer" />
- </form>
- <script>
- var editor = new TINY.editor.edit('editor', {
- id: 'tinyeditor',
- width: 584,
- height: 175,
- cssclass: 'tinyeditor',
- controlclass: 'tinyeditor-control',
- rowclass: 'tinyeditor-header',
- dividerclass: 'tinyeditor-divider',
- controls: ['bold', 'italic', 'underline', 'strikethrough', '|', 'subscript', 'superscript', '|',
- 'orderedlist', 'unorderedlist', '|', 'outdent', 'indent', '|', 'leftalign',
- 'centeralign', 'rightalign', 'blockjustify', '|', 'unformat', '|', 'undo', 'redo', 'n',
- 'font', 'size', 'style', '|', 'image', 'hr', 'link', 'unlink', '|', 'print'],
- footer: true,
- fonts: ['Verdana','Arial','Georgia','Trebuchet MS'],
- xhtml: true,
- cssfile: 'custom.css',
- bodyid: 'editor',
- footerclass: 'tinyeditor-footer',
- toggle: {text: 'source', activetext: 'wysiwyg', cssclass: 'toggle'},
- resize: {cssclass: 'resize'}
- });
- </script>
- </body>
- </html>
- <?php
- include ('../escodeve22/connexion/connexion.php');
- if (isset($_POST['tinyeditor']))
- {
- $annonce=$_POST['tinyeditor'];
- $annonce=addslashes($annonce);
- $insert=mysql_query("INSERT INTO `annonce`(`id_annonce`, `login_admin`, `titre`, `annonce`) VALUES ('','Nabil','hh','$annonce')") or die ('dfgdgdfgfd') ;
- if($insert) {
- echo"<script language='javaScript'>
- alert('Annonce ajoutée. !');
- </script>" ;
- }
- else echo '<span class="error">Erreur. </span>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement