Need help writing a scripts sessions

How to write a script for the redirect page for login. To get in to the user folder that is name with user id and first name (sample folder name 6_tom) and get the file from that folder to load when user login.

hi,

I hope this script will help you for your query.

<?php //script to check if user is login from login form. //if user is successfully logged in then only allow to this script if($user_detail) { $folder = $user_detail['user_id']."_".$user_detail['firstname']; $file = $rootpath."/".$folder."/filename.txt"; $fp = fopen($file, "r"); while(!feof($fp)) { $data .= fgets($fp, 1024); } fclose($fp); echo $data;//data is your file content of user folder } ?>

Thanks for your reply, i’ll try it and let you know if it work

didn’t work for me thanks, i try it like this

<?php //script to check if user is login from login form. //if user is successfully logged in then only allow to this script if($user_detail) { $folder = $user_detail['hdw_id']."_".$user_detail['firstName']; $file = $rootpath."Members/../".$folder."home.php"; $fp = fopen($file, "r"); while(!feof($fp)) { $data .= fgets($fp, 1024); } fclose($fp); echo $data;//data is your file content of user folder } ?>
Sponsor our Newsletter | Privacy Policy | Terms of Service