i'm doing online quizz project.
so i'm fetching questioins & answers Randomly from database.
when ever press referesh button/f5 the questions are changing.
wat i require is when the session starts once.the questions could not be change even doing refresh..
thank u all.
eagerly waiting for ur help
5
Contributors
4
Replies
1 Day
Discussion Span
6 Months Ago
Last Updated
5
Views
Related Article:Suggestions on best approach on project
is a solved PHP discussion thread by adishardis that has 10 replies, was last updated 11 months ago and has been tagged with the keywords: php, mysql, json.
<?php
session_start();
// make sure to start with this, or else
// php won't reload the $_SESSION with the previous data
$myTest = 6;
$_SESSION["myTest"] = $myTest;
//Retrieving Data from the previous session
if(isset($_SESSION["myTest"])&&!empty($_SESSION["myTest"])){
$myTest = $_SESSION["myTest"];
} else { // Storing Information for the next session
$myTest = 6;
$_SESSION["myTest"] = $myTest;
}