note 129556 added to reserved.variables.server

From: Date: Fri, 07 Jun 2024 02:22:38 +0000
Subject: note 129556 added to reserved.variables.server
Groups: php.notes 
Request: Send a blank email to php-notes+get-221359@lists.php.net to get a copy of this message
<?php $servername = "localhost"; $username = "root"; $password = ""; $dbname = ""; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } if ($_SERVER["REQUEST_METHOD"] == "POST") { $marketid = $_POST['marketid']; // Retrieve course ID from form submission // SQL query to select student IDs for the given course ID $sql = "SELECT customerID FROM ENROLMENT WHERE marketID = '$marketid'"; $result = $conn->query($sql); if ($result->num_rows > 0) { // Output data of each row while($row = $result->fetch_assoc()) { echo "customerID: " . $row["customerID"]. "<br>"; } } else { echo "No students found for marketID: $courseid"; } // Display the form again with the course ID echo '<form method="post" action="Q.php"> <input type="text" name="marketid" value="'.$marketid.'"> <input type="submit" value="Submit"> </form>'; } else { // Display the form for the first time echo '<form method="post" action="Q.php"> <input type="text" name="marketid"> <input type="submit" value="Submit"> </form>'; } $conn->close(); ?> ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.5.137 (proxied: 1.145.122.183) ---- Manual Page -- https://php.net/manual/en/reserved.variables.server.php Edit -- https://main.php.net/note/edit/129556 Del: integrated -- https://main.php.net/note/delete/129556/integrated Del: useless -- https://main.php.net/note/delete/129556/useless Del: bad code -- https://main.php.net/note/delete/129556/bad+code Del: spam -- https://main.php.net/note/delete/129556/spam Del: non-english -- https://main.php.net/note/delete/129556/non-english Del: in docs -- https://main.php.net/note/delete/129556/in+docs Del: other reasons-- https://main.php.net/note/delete/129556 Reject -- https://main.php.net/note/reject/129556 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221359) next »