Server IP : 172.16.15.8 / Your IP : 3.12.36.45 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/kdforker/public_html/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php session_start(); if (!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true) { header("location: login.php"); exit; } require_once "config.php"; require "password.php"; $session_user = $_SESSION["username"]; $server = "localhost"; $user = "kdforker"; $pass = "CS389"; $database = "kdforker"; $connect = mysqli_connect($server, $user, $pass); mysqli_select_db($connect, $database); $idSelected = $_POST['selectedApart']; $results = mysqli_query($connect, "SELECT APART_ID, BED_TYPE, BATH_TYPE, SQ_FT, PRICE FROM apartments WHERE id = '$idSelected'"); $information = mysqli_fetch_row($results); $apart_id = $information[0]; $bed_type = $information[1]; $bath_type = $information[2]; $sq_ft = $information[3]; $price = $information[4]; $sql = "INSERT INTO owned (USERNAME, APART_ID, BED_TYPE, BATH_TYPE, SQ_FT, PRICE_RANGE) values ('$session_user', '$apart_id', '$bed_type', '$bath_type', '$sq_ft', '$price')"; mysqli_query($connect, $sql); $update = mysqli_query($connect, "UPDATE apartments SET AVAILABILITY = 'Occupied' WHERE id = '$idSelected'"); mysqli_close($connect); header("location: index.php"); ?>