I apologise if this question has been asked, I have looked and can't find an answer that fits but if I'm wrong please tell me!
I've created a login form and when the user logs in they can see their Name, E-mail, Phone and Availability. At the moment this is just echoing / printing the information from the MySQL database. What I was wondering is how I make this editable so that the logged in user can update their own information?
Thanks an absolute bunch to everyone by the way, I'm new to this site and everyone has been extremely helpful. I'm not a developer by trade and very much learning as I go on this project so it is appreciated! :)
<?php
session_start();
$sessData = !empty($_SESSION['sessData'])?$_SESSION['sessData']:'';
if(!empty($sessData['status']['msg'])){
$statusMsg = $sessData['status']['msg'];
$statusMsgType = $sessData['status']['type'];
unset($_SESSION['sessData']['status']);
}
?>
<div class="container">
<?php
if(!empty($sessData['userLoggedIn']) && !empty($sessData['userID'])){
include 'user.php';
$user = new User();
$conditions['where'] = array(
'id' => $sessData['userID'],
);
$conditions['return_type'] = 'single';
$userData = $user->getRows($conditions);
?>
<h2>Welcome <?php echo $userData['first_name']; ?>!</h2>
<a href="userAccount.php?logoutSubmit=1" class="logout">Logout</a>
<div class="regisFrm">
<p><b>Name: </b><?php echo $userData['first_name'].' '.$userData['last_name']; ?></p>
<p><b>Email: </b><?php echo $userData['email']; ?></p>
<p><b>Phone: </b><?php echo $userData['phone']; ?></p>
<p><b>Available: </b><?php echo $userData['available']; ?></p>
<li><a href=profile.php>Update Profile<a></li><br>
<form action="change.php" method="post">
Are you available this weekend?<br>
<input type="radio" name="available" value="yes"> Yes<br>
<input type="radio" name="available" value="no"> No<br>
<input type="submit" value="Submit">
</form>
</div>
<?php }else{ ?>
<h2>Login to Your Account</h2>
<?php echo !empty($statusMsg)?'<p class="'.$statusMsgType.'">'.$statusMsg.'</p>':''; ?>
<div class="regisFrm">
<form action="userAccount.php" method="post">
<input type="email" name="email" placeholder="EMAIL" required="">
<input type="password" name="password" placeholder="PASSWORD" required="">
<div class="send-button">
<input type="submit" name="loginSubmit" value="LOGIN">
</div>
</form>
<p>Don't have an account? <a href="registration.php">Register</a></p>
</div>
<?php } ?>
</div>