Server IP : 68.65.122.142 / Your IP : 3.144.34.110 Web Server : LiteSpeed System : Linux server167.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64 User : glenirhm ( 1318) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/glenirhm/mygc.glenbowcollege.ca/admin/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php // We need to use sessions, so you should always start sessions using the below code. session_start(); // If the user is not logged in redirect to the login page... if (!isset($_SESSION['loggedin'])) { header('Location: index.html'); exit; } include('../common/header_admin.php'); // Connect to the database include('../common/connect.php'); include('../common/connectPDO.php'); include('../common/send_email.php'); // From PHPMailer code require '../../composer/vendor/autoload.php'; //Using GET, get the student_id from view_records.php $id = $_GET['id']; //echo $student_id; ?> </div> <!DOCTYPE html> <html> <body> <form action="admin2student_email_process.php?id=<?php echo $id?>" method="post"> <label for="subject">Type email subject:</label> <textarea id="subject"name="subject"rows="1"cols="100"> </textarea> <label for="message">Type email message:</label> <textarea id="message"name="message"rows="4"cols="100"></textarea> <br><br><br> <label>Check all the files below you would like to send to the student.</label><br> <?php //LIST ALL POSSIBLE ATTACHMENT FILES // Define the full path to your folder from root $path = "attachments/"; // Open the folder $dir_handle = @opendir($path) or die("Unable to open $path"); // Loop through the files while ($file = readdir($dir_handle)) { if($file == "." || $file == ".." || $file == "index.php" ) { continue; } // Prints a checkbox after each file. // The checkboxes are received by the form handler as an array called $files[] // holding the filenames of the files you want deleted. echo "<input type='checkbox' name='files[]' value='$file' /> $file<br />\n"; } // Close closedir($dir_handle); ////////////////////////////////////// // Store all the email data in the variable below //$_SESSION['email_data'] = $email_data; ?> <br><br> <input type="submit" name="submit"> </form> <p>Click the "Submit" button and the form-data will be sent to the student as an email.</p> </body> </html>