Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Opening Database Connection.
- $cxn = mysqli_connect($hostname,$username,$password,$database) or die ("Couldn't connect to GC server.");
- //CHECKING FOR EXISTING KEY
- //Check to see if a POST request has been submitted.
- if(!empty($_POST)) {
- //A POST request was submitted, so define the variables.
- $VER = $_POST['version'];
- //Create the query and send it to the database.
- $sql = "SELECT * FROM Development WHERE ID = '".$VER."'";
- $result = mysqli_query($cxn, $sql);
- //If the database finds at least one row...
- if(mysqli_num_rows($result) > 0) {
- //Set the associative array.
- $data = mysqli_fetch_assoc($result);
- echo $data['Version'];
- //If the version is not found.
- } else {
- echo "Wrong Version!";
- }
- } else {
- //A POST request was not submitted, so display an error.
- echo "Sorry! You're not allowed to view this page.";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement