user);$i++){ if($statusf->user[$i]==$_SESSION['username']){ $userexist=true; break; } if($userexist==true){break;} } $i=0; fwrite($file, ''."\n".''."\n"); $wrote=false; foreach($statusf as $status){ if(($statusf->user[$i]==$_SESSION['username'])||($userexist==false)){ if($userexist==false){ fwrite($file, ' '.$statusf->user[$i]."\n"); } if($wrote==false){fwrite($file, ' '.$_SESSION['username']."\n"); $wrote=true;} } else { fwrite($file, ' '.$statusf->user[$i]."\n"); } $i++; } fwrite($file, ''); fclose($file); } } $_SESSION['username']=""; $_SESSION['password']=""; } if($_SESSION['username']==""||$_SESSION['username']=="guest"){ if($_POST['username']==""){ $_SESSION['username']="guest"; $_SESSION['password']="password"; } else { $_SESSION['username']=$_POST['username']; $_SESSION['password']=$_POST['password']; } } $_POST['username']=""; $_POST['password']=""; if($_SESSION['username']!="guest"){ $stmt=$dbc->prepare("select username,password from ".$dbc_ver_accounts." where username=?"); $stmt->execute([$_SESSION['username']]); $getuser=$stmt->fetch(); if($getuser[0]==$_SESSION['username']){ if(password_verify($_SESSION['password'],$getuser[1])){ $login_correct="true"; } else { $_SESSION['username']="guest"; $_SESSION['password']="password"; $_SESSION['errormsglogin']="login info is incorrect"; $login_correct="false"; } } else { $_SESSION['username']="guest"; $_SESSION['password']="password"; $_SESSION['errormsglogin']="login info is incorrect"; $login_correct="false"; } } $stmt=null; $getuser=null; if(file_exists("../account_data/".$_SESSION['username'].".png")){ $_SESSION['profilepicture']="../account_data/".$_SESSION['username'].".png"; } elseif(file_exists("../account_data/".$_SESSION['username'].".jpg")){ $_SESSION['profilepicture']="../account_data/".$_SESSION['username'].".jpg"; } elseif(file_exists("../account_data/".$_SESSION['username'].".gif")){ $_SESSION['profilepicture']="../account_data/".$_SESSION['username'].".gif"; } else { $_SESSION['profilepicture']="../account_data/guest.png"; }*/ ?>