I am trying to make an update in my database using two post variables, one from file clientpag.php and another from login.php. The variable $_POST['add'] which is an input from clientpag.php is not being saved. Can you help please? it is my first project using php!
LoginScript.php
<?php
session_start();
include_once'config/connect.php'; //database connection
if($_POST['submit']) {
$address = mysql_query("UPDATE venue SET location='".$_POST['add']."'
WHERE vid = (select vid from user_venue where id = (select user_id from iangadot_user
where username='".$_POST['username']."' ))");
while($row = mysql_fetch_assoc($address)){
$_SESSION['add'] = $row['location'];
}
header("Location: clientpag.php");
} else {
echo "<script language=javascript>alert('error')</script>";
}
?>
clientpag.php
<?php session_start(); ?>
<!DOCTYPE html>
<html>
<body>
<form action="LoginScript.php" method="POST">
<p>Address:</p> <input class = "field" name="add" placeholder= "<?php
if(isset($_SESSION['address'])) { echo $_SESSION['address']; } ?>" type="text" >
<input class = "button" type = "submit" Value = "Save"><br>
</form>
</body>
</html>