I currently have 3 pages: index.php, Insertred.php andhomered.php
Homered is a form that updates to the database after submission and Index.php is a page that shows the results.
I've done some searching about auto refreshing page but all of them are timer refresh.
Is it possible to make index.php automatically refresh on homered.php submission? Currently it does this: homered.php submit button > insertred.php > index.php
homered.php: (removed the php part as its just session checks)
<html>
<head>
<link rel="stylesheet" type="text/css" href="homered.css">
</head>
<body>
<div class="centerimage">
<img src="images/anonymousfacepng.png" alt="Avatar" align="middle">
</div>
<div class="home-page">
<div class="form">
<form class="home-form" action="insertred.php" method="post">
<input type="text" placeholder="FTP Password" name="FTPBreach"/>
<input type="text" placeholder="XP2 Victim IP" name="VictimIP"/>
<input type="text" placeholder="XP2 Victim Password" name="VictimPass"/>
<input type="text" placeholder="SQL Username" name="SQLUser"/>
<input type="text" placeholder="SQL Password" name="SQLPass"/>
<button>Submit</button>
<p class="message"><a href="logoutred.php">logout</a></p>
</form>
</div>
</div>
</body>
<footer>
©
</footer>
</html>
Insertred.php:
<?php
$db = mysqli_connect('prjtest1', 'root', 'test', '165619z_database');
if (!$db)
{
die('Could not connect: ' . mysql_error());
}
$currenttime = date('Y-m-d H:i:s');
echo $sql="UPDATE indextableredupdated SET FTPBreach = '$_POST[FTPBreach]', VictimIP = '$_POST[VictimIP]', VictimPass = '$_POST[VictimPass]', SQLUser = '$_POST[SQLUser]', SQLPass = '$_POST[SQLPass]', message = '$_POST[message]', time = '$currenttime' WHERE user = '2'" ;
$query = mysqli_query($db,$sql);
if (!mysqli_query($db, $sql))
{
die('Error: ' . mysql_error());
}
if($query)
{
header("location: index.php");
}
?>
Not sure if you need the codes for index.php as it's quite long. TLDR; i need index.php to refresh only after insertred.php