Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('connect.php');
- if (isset($_SESSION['user_id'])) { ;
- $user_id = $_SESSION['user_id'];
- } else {
- $user_id = 0;
- }
- // Look into SQL injection protection
- $title = $_POST['title'];
- $content = $_POST['content'];
- $addTestimonial = mysql_query("INSERT INTO testimonial (title, content, user_id, date_created) VALUES ('$title', '$content', '$user_id', NOW())");
- if($addTestimonial) {
- echo 'Testimonial Added Succesfully.';
- echo '<meta http-equiv="refresh" content="2;url=testimonial.php">';
- } else {
- echo 'Error adding testimonial.';
- echo '<meta http-equiv="refresh" content="2;url=addTestimonial.php">';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement