Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- process.php
- <?php
- if(isset($_POST['btn-send']))
- {
- $UserName = $_POST['UName'];
- $Email = $_POST['Email'];
- $Subject = $_POST['Subject'];
- $Msg = $_POST['msg'];
- if(empty($UserName) || empty($Email) || empty($Subject) || empty($Msg))
- {
- header('location:index.php?error');
- }
- else
- {
- if(mail($to,$Subject,$Msg,$Email))
- {
- header("location:index.php?success");
- }
- }
- }
- else
- {
- header("location:index.php");
- }
- ?>
- index.php
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <link rel="stylesheet" href="bootstrap.css">
- <title>Request</title>
- </head>
- <body>
- <div class="container">
- <div class="row">
- <div class="col-lg-6 m-auto">
- <div class="card mt-5">
- <div class="card-title">
- <h2 class="text-center py-2"> Track Information </h2>
- <hr>
- <?php
- $Msg = "";
- if(isset($_GET['error']))
- {
- $Msg = " Please Fill in the Blanks ";
- echo '<div class="alert alert-danger">'.$Msg.'</div>';
- }
- if(isset($_GET['success']))
- {
- $Msg = " Request successful and should play shortly. ";
- echo '<div class="alert alert-success">'.$Msg.'</div>';
- }
- ?>
- </div>
- <div class="card-body">
- <form action="process.php" method="post">
- <input type="text" name="UName" placeholder="Your Name" class="form-control mb-2">
- <input type="text" name="Email" placeholder="Track Name" class="form-control mb-2">
- <input type="text" name="Subject" placeholder="Artist Name" class="form-control mb-2">
- <textarea name="msg" class="form-control mb-2" placeholder="Dedication Message"></textarea>
- <button class="btn btn-success" name="btn-send"> Dedicate It! </button>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment