Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ($_POST) {
- $comment = mysql_real_escape_string($_POST['comment']);
- $author = mysql_real_escape_string($_POST['author']);
- $company = mysql_real_escape_string($_POST['company']);
- $date = date("l, F jS Y");
- if ($author == "") {
- echo ("author");
- }
- elseif ($company == "") {
- echo ("company");
- }
- elseif($comment == "") {
- echo ("Comment ");
- }
- else {
- // Insert the review
- $insertReviews = "INSERT INTO reviews (comment, author, company, date) VALUES ('{$comment}', '{$author}', '{$company}', '{$date}')";
- mysql_query($insertReviews) or die("MySQL Error - Could not insert reviews");
- echo ('<div class="alert alert-success" style="margin: 8px; text-align: center;"><strong>Success:</strong> Your review has been successfully submitted!</div>');
- }
- }
- else {
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement