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

  • SEARCH
  • Home
  • 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 8702195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:35:33+00:00 2026-06-13T02:35:33+00:00

I have created a webpage using php and mysql, the code works fine except

  • 0

I have created a webpage using php and mysql, the code works fine except the problem is I have included so many submit buttons and hence my webpage gets redrawn many times. I lose some values i.e. $emirate value and $areas value. I used a variable $choice for storing those values but since the page is being redrawn, I don’t get the values. Help me please.

$data = mysql_query("SELECT * FROM emirate") 
    or die(mysql_error()); 

    $choice="";

    Print "<table border cellpadding=3>"; 
    print"<tr><th><form method=get action=''><select id=EMIRATE size=1 name='EMIRATE' class='comboBoo'>";
    while($info = mysql_fetch_array( $data )) 
    { 
        Print "<option value=". $info['em_name'] .">".$info['em_name']."</option>"; 
    }
    print"</select><input type=submit value=OK></form></th>";
    if(isset($_GET['EMIRATE'])){
        $emirate=$_GET['EMIRATE'];
        $choice.=$emirate;
        $data = mysql_query("SELECT a_name FROM areas where em_id=(select em_id from emirate where em_name=\"".$emirate."\")") 
        or die(mysql_error());
        Print "<th><form method=get action=''><select id='AREAS' name=AREAS size=1 class='comboBoo'><OPTION value=ALL>ALL</option><OPTION value=ALL>ALL</option>";
        while($info = mysql_fetch_array( $data ))
        {
            Print "<option >".$info['a_name']."</option>";
        }
        print"</select><input type=submit value=OK></form></th>";
    }

    $choice.="->";

    if(isset($_GET['AREAS'])){
        $areas=$_GET['AREAS'];
        $choice.=$areas;
        $data = mysql_query("SELECT h_name FROM hypermarket_em where a_id=(select a_id from areas where a_name=\"".$areas."\")")
        or die(mysql_error());
        Print "<th><form method=get action=''><select name=HYPERMARKETS size=1 class='comboBoo'>";
        while($info = mysql_fetch_array( $data ))
        {
            Print "<option>".$info['h_name']."</option>";
        }
        print"</select><input type=submit value=OK></form></th>";
    }   
    Print "</tr></table>";
    Print "<table border cellpadding=3><tr><th>".$choice."</th></tr></table>";

how can i retain them??

  • 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-13T02:35:34+00:00Added an answer on June 13, 2026 at 2:35 am
    $choice="";
    
        Print "<table border cellpadding=3>"; 
        print"<tr><th><form method=get action=''><select id=EMIRATE size=1 name='EMIRATE' class='comboBoo'>";
    
     print"</select><input type=hidden name='areas_hidden' value=<?php echo $_GET['AREAS'] ?>/>"
     print"</select><input type=hidden name='emerates_hidden' value=<?php echo $_GET['EMIRATE'] ?>/>"
    </th>";
    

    submit these value with both your forms submission action.then you will have both on your url.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very AJAX-ish listing webpage created using Codeigniter where I want registered
I have created a Webpage which will post as post method..not as get method.
I am experiencing a minor difficulty. I have a webpage, and have created a
I'm creating a dictionary database using php and MySQL. The user can search for
I have created a web page using JQuery Mobile that has a link at
I have to store hindi text in a MySQL database, fetch it using a
I am building a Web2Print website using PHP, MySQL and jQuery.The main concept of
Using Java, I have a class which retrieves a webpage as a byte array.
I have created a chart using JFreeChart inside a JSP. I want to render
I recently created a webpage, while using an usbWebserver, so basically a local server.

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.