Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="box header" style="display:block">
- Comments & Suggestions
- </div>
- <div class="box content"style="display:block">
- <form id="comment_form" action="" method="post">
- <span>Fill this form to give us a Comment or a Suggestion</span><br><br>
- <label for="name"><b>Your Name:</b></label>
- <input type="text" name="name" id="name" required>
- <label for="email"><b>Your Email:</b></label>
- <input type="text" name="email" id="email" required>
- <label for="comment"><b>Your Comment / Suggestion:</b></label>
- <textarea form="comment_form" id="comment" name="comment" placeholder="Write here!" required></textarea>
- <input type="submit">
- </form>
- </div>
- <?php
- if(isset($_POST['submit'])){
- $name = $_POST['name'];
- $email = $_POST['email'];
- $message = $_POST['comment'];
- $txt= "
- \n--- " . date() . "---\n
- Name: " . $name . "\n
- Email: " . $email . "\n
- Comment: \n" . $message . "\n
- --- END OF COMMENT ---
- ";
- $file = fopen("comments.log", "a");
- fwrite($txt, $file);
- fclose($file);
- $html = '<style>
- @import url("https://fonts.googleapis.com/css?family=Roboto");
- body{
- background-color: #e2e2e2;
- font-family: "Roboto", sans-serif;
- }
- .box{
- font-family: "Roboto", sans-serif;
- border: 3px solid #6da5ff;
- border-radius: 3px;
- background: #fff;
- padding: 1%;
- box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
- width: 350px;
- font-size: 15px;
- }
- .message{
- border: 1px dashed grey;
- border-radius: 1px;
- width: 350px;
- }
- header{
- font-size: 20px;
- }
- </style>
- <div class="box">
- <header>New Comment on <strong>LocaTunes</strong></header>
- <b>Sender Name: </b>' . $name . '<br>
- <b>Sender Email: </b>' . $email . '<br>
- Message:
- <div class="message">
- <pre>' . $message . '</pre>
- <font size="3">Service provided by <a href="https://electronic.perina.net/">Perina Electronic</a>/Yanko</font>
- </div>
- </div>
- ';
- require 'class.phpmailer.php';
- $mail = new PHPMailer;
- $mail->IsSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smtp.gmail.com'; // Specify main and backup server
- $mail->Port = 465; // Set the SMTP port
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = '[email protected]'; // SMTP username
- $mail->Password = 'escoteiros129'; // SMTP password
- $mail->SMTPSecure = 'ssl'; // Enable encryption, 'ssl' also accepted
- $mail->From = '[email protected]';
- $mail->FromName = 'Comment MailBot';
- $mail->AddAddress('[email protected]', 'CyberBoy'); // Add a recipient
- $mail->IsHTML(true); // Set email format to HTML
- $mail->Subject = 'LocaTunes - New comment from: ' . $name;
- $mail->Body = $html;
- if(!$mail->Send()) {
- echo 'Comment could not be sent.';
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- exit;
- }
- echo 'Your comment has been sent!';
- }
- ?>
- <style>
- @import url('https://fonts.googleapis.com/css?family=Roboto');
- body{
- font-family: 'Roboto', sans-serif;
- background-color: #e2e2e2;
- }
- error{
- color: #f73333;
- }
- /* Box & Content */
- .box{
- border-bottom-right-radius: 2px;
- border-bottom-left-radius: 2px;
- background: #fff;
- display: inline-block;
- margin-left: 1rem;
- position: relative;
- padding: 1%;
- box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
- transition: all 0.3s cubic-bezier(.25,.8,.25,1);
- width: 500px;
- height: auto;
- }
- .box:hover {
- box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
- }
- .header{
- border-top-left-radius: 2px;
- border-top-right-radius: 2px;
- background-color: #0fb7ff;
- display: inline-block;
- margin-left: 1rem;
- position: relative;
- padding: 1%;
- box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
- transition: all 0.3s cubic-bezier(.25,.8,.25,1);
- width: 500px;
- height: auto;
- }
- /* INPUTS */
- input[type=text] {
- width: 100%;
- padding: 12px 20px;
- margin: 8px 0;
- box-sizing: border-box;
- border: 1px solid grey;
- border-radius: 4px;
- transition: border 0.25s;
- -webkit-transition: border 0.25s; /* Safari 3.1 to 6.0 */
- }
- input[type=text]:focus{
- border: 3px solid #6da5ff;
- outline: none;
- }
- input[type=submit] {
- width: 100%;
- padding: 12px 20px;
- margin: 8px 0;
- box-sizing: border-box;
- border: 1px solid grey;
- border-radius: 4px;
- transition: background-color 0.25s;
- -webkit-transition: background-color 0.25s; /* Safari 3.1 to 6.0 */
- }
- input[type=submit]:hover{
- background-color: green;
- outline: none;
- }
- textarea {
- width: 100%;
- padding: 12px 20px;
- margin: 8px 0;
- box-sizing: border-box;
- border: 1px solid grey;
- border-radius: 4px;
- transition: border 0.25s;
- -webkit-transition: border 0.25s; /* Safari 3.1 to 6.0 */
- }
- textarea:focus{
- border: 3px solid #6da5ff;
- outline: none;
- }
- </style>
Add Comment
Please, Sign In to add comment