So I've searched all over and found all sorts of solutions that just don't work.
I have a registration page that inserts data into my database, which works. I have an if/else statement that should redirect to one of two pages depending if the insertion was successful or not. Right now it just shows a blank page after the form is submitted.
<?php
$hostname="xxxxxxxxxxxxxxxxxxxxx";
$username="xxxxxxxxxxxx";
$password="xxxxxxxxx";
$database="xxxxxxxxxxxxx";
$db = new mysqli($hostname, $username, $password, $database);
if ($db->connect_error){
die("Connection failed: " . $db->connect_error);
}
$pw = $_POST['pw'];
$UIN = $_POST['UIN'];
$sql = "INSERT INTO studentLogin (pw, UIN) VALUES ('$pw', '$UIN')";
if ($db->query($sql) === TRUE) {
header('Location: http://my_url/success.php.php?msg=WELCOME STUDENT');
exit();
} else {
header('Location: http://my_url/failure.php.php?msg=You must be a student to register for the student discussion page');
exit();
}
$db->close();
?>