-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlakshit.php
72 lines (66 loc) · 2.93 KB
/
lakshit.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Tinymce Editor in using PHP Example - Nicesnippets.com</title>
<!-- include Boostrap 5 -->
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" />
<!-- include tinymce -->
<script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.min.js" referrerpolicy="origin"></script>
</head>
<body>
<?php
include "dbconnect.php";
if(isset($_POST['submit'])){
$title = $_POST['title'];
$long_desc = $_POST['long_desc'];
if($title != ''){
mysqli_query($link, "INSERT INTO contents(title,long_desc) VALUES('".$title."','".$long_desc."') ");
header('location: lakshit.php');
}
}
?>
<div class="container mt-4">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header text-center bg-danger text-white">
<h4>Tinymce Editor in using PHP Example - Nicesnippets.com</h4>
</div>
<div class="card-body">
<form method='post' action=''>
<div class="mb-3">
<label><strong>Title :</strong></label>
<input type="text" name="title" class="form-control">
</div>
<div class="mb-1">
<label><strong>Long Description :</strong></label>
<textarea id="mytextarea" name='long_desc' class="form-control"></textarea><br>
</div>
<div class="d-flex justify-content-center">
<input type="submit" name="submit" value="Submit" class="btn btn-success">
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- Script -->
<script>
tinymce.init({
selector: '#mytextarea',
plugins: [
'a11ychecker', 'advlist', 'advcode', 'advtable', 'autolink', 'checklist', 'export',
'lists', 'link', 'image', 'charmap', 'preview', 'anchor', 'searchreplace', 'visualblocks',
'powerpaste', 'fullscreen', 'formatpainter', 'insertdatetime', 'media', 'table', 'help',
'wordcount'
],
toolbar: 'undo redo | formatpainter casechange styleselect | bold italic backcolor | ' +
'alignleft aligncenter alignright alignjustify | ' +
'bullist numlist checklist outdent indent | removeformat | a11ycheck code table help'
});
</script>
</body>
</html>