Category : session

I have my Codeigniter application running in htdocs ==> htdocs/ciapp And core php application also in htdocs ==> htdocs/coreapp Both apps are using a single MySQL DB User lands on ciapp and login there, Afterwards, the user goes to coreapp and also login there. Authentication is done from the same user table (using the same ..

Read more

I want to create a quiz with some questions($_SESSION[‘allquestions’]). Now I want to add a progress bar for some nice visuals why I used this code: <?php if($_SESSION[‘answeredquestions’]>0){ $goal=$_SESSION[‘allquestions’]; $done=$_SESSION[‘answeredquestions’]; echo $done/$goal;} ?> <body class="small-container text-center " style="font-family: ‘Times New Roman’, Times, serif; font-size: 40px; color:#45A29E;"> <div class="progress"> <div class="progress-bar" role="progressbar" style="width: 10%;" aria-valuenow="25" aria-valuemin="0" ..

Read more

This is pageA.php <?php $_SESSION[‘user’]=’foo’; echo $_SESSION[‘user’]; $url = ‘https://www.mywebsite.com/pageB.php’; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); $result = curl_exec($ch); curl_close($ch); ?> …and this is pageB.php <?php echo $_SESSION[‘user’]; ?> Pages belong to the same domain. I need page B print the session content set in A, so ‘foo’. I think the problem is that looking ..

Read more

Background I created a custom auth middleware to check if user is already logged in. If logged user visit login page, it redirects him to dashboard. If non-logged user visit dashboard page, it redirects him to the login page. I use LaravelLocalization as multi language plugin. Problem During testing, everything works fine. I could login, ..

Read more

I have a listing page (mysite.com/listing) in PHP that uses a foreach loop. It outputs a user ID e.g. user1, user2 and a link to a detail page eg: mysite.com/detail Output: 1. User ID = user1 <a href="mysite.com/detail">Detail Page</a> 2. User ID = user2 <a href="mysite.com/detail">Detail Page</a> … 10. User ID = user10 <a href="mysite.com/detail">Detail ..

Read more