Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9078441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:37:25+00:00 2026-06-16T19:37:25+00:00

I am developing a smartphone web app that is a game of question answer

  • 0

I am developing a smartphone web app that is a game of question answer using jquerymobile API.
when a user click on next button that is a anchor tag then i switch to other page and increment the $_SESSION[‘questionNo’] value. The problem is $_SESSION[‘questionNo’] value increment from 1 to 4 and then again became $_SESSION[‘questionNo’] is 1. why it’s happening i don’t know. Here is my code

<?php session_start();
include("connect.php");
include("header1.php");

$attemp=$_SESSION['questionNo'];
echo $attemp;
$sql = sprintf("select * from question order by pk_id ASC limit %s,%s",$attemp,1);
$result = mysql_query($sql) or die(mysql_error());
$result2=mysql_fetch_array($result);
?>

<div data-role="page" id="group">
<div class="main">
<div id="header2" class="clearfix">
<table  border="0" width="100%" id="table">

<tr><td colspan="5"><hr></td></tr>
<tr>
<td colspan="2" id="menu_button1">
    <a href="reset.php" rel="external">Reset</a>
</td>

<td align="center">
    Score : 50%
</td>
<td>&nbsp;</td>
<td id="menu_button2">
    <a href="test.php" rel="external">Next</a>
</td>
</tr>

-------------
test.php page
-------------
<!DOCTYPE html> 
<html> 
<head> 
    <title>My Page</title> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <link href="css/style.css" media="handheld, screen" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="../css/jquery.mobile-1.0a1.min.css"/>
    <script src="jquery-1.4.3.min.js"></script>
    <script src="jquery.mobile-1.0a2.min.js"></script>
    <script src="jquery-1.8.2.min.js"></script>
</head> 
<body> 

<div data-role="page">

    <div data-role="header">
        <h1>My Title</h1>
    </div>

    <div data-role="content">   
        <?php 
            ++$_SESSION['questionNo'];
            header('Location:startGame.php');
            exit;
        ?>      
    </div><!-- /content -->

</div><!-- /page -->

</body>

can any one tell me why $_SESSION[‘questionNo’] not incrementing regularly???

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T19:37:27+00:00Added an answer on June 16, 2026 at 7:37 pm

    Use session_start():

    <?php 
    session_start();
    ++$_SESSION['questionNo'];
    header('Location:startGame.php');
    exit;
    ?> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Developing a web application that will act similar to a daily journal. The user
I'm currently developing a web-app, that has to run on both computer systems and
Developing a web application that I've registered with Twitter. In this app, I might
We're developing an Android app that relies on the accelerometer for certain features. I'm
I hope this question belongs here. I am developing a web application for a
Possible Duplicate: Developing an Android smartphone app - on which devices would YOU suggest
Developing a simple game for the iPhone, what gives a better performance? Using a
I will be developing an smartphone app (eg iOS) in either actionscript 3 with
Developing a WP7 app, and I'm trying to post something to the user's feed.
Developing iPhone Application with Entertainment domain and what to implement that when user download

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.