php - Updating user information -
i know can't use 2 session start codes in same php page sake of updating user account, need below code , need use session_start twice. one, check if user not logged in, redirect them , banned them seeing update info page , other session start has there session variables set automatically in update info page if user logged in.
anyways, getting error can guys please show me work around way? if there's any?
thanks. notice: session had been started - ignoring session_start() in ....
<?php session_start(); if(isset($_session['userid'])) { } else { header('location: login.php'); } ?> <?php $user = $_session['userid']; $myquery = "select * our_users `userid`='$user'"; $result = mysqli_query($conn, $thequery); $row = mysqli_fetch_array($result, mysqli_both); session_start(); /* right here gets ignored. */ $_session["user_first_name"] = $row['fn']; $_session["user_last_name"] = $row['ln']; $_session["user_email"] = $row['em']; $_session["user_password"] = $row['pw']; ?>
Comments
Post a Comment