php update profile

denaux24
08:29:16
if(@$_GET['action'] == "logout") {
session_destroy();
header("Location: logins.php");
}

if (@$_GET['action'] == "cp") {
echo "<form action='updateprofile.php?action=up' method='post'><center>";
echo "
firstname: <input type='text' name='firstname'><br>
Lastname: <input type='text' name='lastname'><br>
Email: <input type='text' name='lastname'><br>
dob: <input type='date' name='dob'><br>
<input type='submit' name='updateprofile' value='update'><br>
";
$firstname = @$_POST['firstname'];
$lastname = @$_POST['lastname'];
$email = @$_POST['email'];
$dob = @$_POST['dob'];

if(!empty($firstname))
{
mysqli_query("UPDATE Profile SET `firstname`='$firstname' WHERE Username='".$_SESSION['username']."'") or die(mysql_error());
echo("You have successfully updated your firstname");
}
if(!empty($lastname))
{
mysqli_query("UPDATE Profile SET 'lastname'='$lastname' WHERE Username='".$_SESSION['username']."'") or die(mysql_error());
echo("You have successfully updated your Lastname");
}
if(!empty($dob))
{
mysqli_query("UPDATE Profile SET email='$email' WHERE Username='".$_SESSION['username']."'") or die(mysql_error());
echo("You have successfully updated your Email");
}
if(!empty($aCC))
{
mysqli_query("UPDATE Profile SET dob='$dob' WHERE Username='".$_SESSION['username']."'") or die(mysql_error());
echo("You have successfully updated your Date of birth");
}
}
?>
denaux24
08-29-2016
can anybody help me check for my errors in this page and probably help me with the corrections...thanks
smo1234
09-02-2016
What is the error message you are getting ?
Please Login to post your reply or start a new topic