I have a form that has an action sent to create_user.php
The create_user.php deals with the information and INSERT into a mysql table and a header("Location: ../../register/register-2.php"); is sent.
$insertSQL = sprintf("INSERT INTO di_ssenisub (timestamp,
username,
password)
VALUES (NOW(), %s, %s)",
GetSQLValueString($username_entry, "text"),
GetSQLValueString($hashPass, "text"));
if (mysqli_query($link, $insertSQL)) {
header("Location: ../../register/register-2.php");
} else {
echo "Error: " . $insertSQL . "<br>" . mysqli_error($link);
}
mysqli_close($link);
}
I want the variables sent to the register-2.php page aswell so I can call everything back from the database table like so.
require '../scripts/php/db_connect.php';
$username_check = $_POST['username_entry'];
if($result = $link->query("SELECT * FROM di_ssenisub WHERE username = '$username_check'")) {
if($count = $result->num_rows) {
$rows = $result->fetch_assoc();
}
}
echo $rows['username'];
echo $rows['password'];
echo $rows['id'];
echo $rows['timestamp'];
The problem is sending the variable to the next page. Can anyone help?
include '../../register/register-2.php';instead ofheader("Location: ../../register/register-2.php");