Server IP : 172.16.15.8 / Your IP : 3.145.57.41 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/bdstamour/www/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php session_start(); if (isset($_SESSION['username'])) { ?> <HTML> <HEAD> <TITLE>FirstStep </TITLE><link rel="stylesheet" type="text/css" href="research.css"> </HEAD><BODY> <CENTER> <H2> My Interests </H2><HR><Form action=PartnersListAction.php method=post><p> <?php $host = 'localhost'; $user = 'bdstamour'; $passw = 'cs480'; $database = 'bdstamour'; $connect = mysqli_connect($host, $user, $passw); mysqli_select_db($connect, $database); $usernamesesh = $_SESSION['username']; $interestsremove = $_POST['interestsremove']; $query = "select id from FirstStep2 where username='$usernamesesh'"; $UserArray = mysqli_fetch_array(mysqli_query($connect, $query)) or die(mysqli_error($connect)); $UserID = $UserArray[0]; if(count($interestsremove) == 0) { print "You didn't remove any interests."; } else { print "You removed the following interest(s): <p>"; print '<table border=1>'; print '<th>Interest'; for($n=0; $n<count($interestsremove); $n++) { $query = "select Interest from Interests where UserID='$UserID' and Interest='$interestsremove[$n]'"; $result = mysqli_query($connect, $query) or die(mysqli_error($connect)); while($row = mysqli_fetch_row($result)) { if(in_array($n, $interestsremove)) { print "<tr>"; foreach($row as $field) { print "<td>$field</td>"; } print "</tr>"; mysqli_query($connect, "delete from Interests where UserID='$UserID' and Interest='$interestsremove[$n]'"); } } print "<p>"; } } ?> </table> <?php } else { ?> <CENTER> <?php print "You are not logged in. Please <A HREF=FirstStepIndex.php>login.</A><p>"; print "<A HREF=NewUser.php>Not registered? Let's get started!</A><p>"; } ?> <HR> <?php include("date.php"); ?> </HTML> </CENTER> </BODY>