<?php
$link = mysqli_connect("localhost", "root", "", "prerentdb");
// Check connection
if($link === false){ die("ERROR: Could not connect. " . mysqli_connect_error()); }
$id='id';
echo "<center>";echo date('m/d/y');echo "<br />";
// Attempt select query execution
$result = mysqli_query($link,"SELECT * FROM numbers");
$row= mysqli_fetch_array($result);
$id='id';
$expiry='expiry';
if ($_POST["expiry"] === $_POST["confirm_password"]) {
$sql = "UPDATE numbers SET expiry = $expiry-1 where id=$id ";
if(mysqli_query($link, $sql)){ echo "expiry was updated successfully."; }
else { echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); }
if ($expiry == 0) // go to expiredpage.html
{
header("location:expiredpage.html");
}
else // go to sysnav.html
{
header("location:sysnav.html");
}
// Close connection
mysqli_close($link);
?>
Edited by hamluis, 08 August 2021 - 07:30 PM.
Merged topics - Hamluis.



Back to top







