<?php
$_SESSION['sdate'] = $_POST['sdate'];
$_SESSION['edate'] = $_POST['edate'];
//assigning the variables in sessions
$sdate = $_POST['sdate'];
$edate = $_POST['edate'];
$query = mysqli_query($conn,"INSERT INTO subscribers (username, password, sdate, edate, day )
VALUES ('".$_SESSION['username']."','".$_SESSION[md5(password-1)]."','".$sdate."', '".$edate."', 50");
//inserting into the table subscribers
''
if ($conn -> $query === TRUE) {
$_SESSION['message'] = "subscription Complete!";
header("location: ../register/error.php");
//success location
}
else{
$_SESSION['message'] = "subscription Failed!";
header("location: ../register/error.php");
}
?>
I have been trying to insert session variables in the table but its bringing out a parse error :
'Parse error: syntax error, unexpected 'if' (T_IF) in C:\xampp\htdocs\bennett\subscription\function.php on line 15'