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 7188979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:12:13+00:00 2026-05-28T19:12:13+00:00

<?php /*random1 is a randomly generated number*/ if($_GET){ /*picking ‘i’ using $_GET and doing

  • 0
<?php
/*random1 is a randomly generated number*/
if($_GET){
 /*picking 'i' using $_GET and doing a query in mysql*/
 /*Unable to pick the value from select box, using either $_GET or $_POST*/
 }
else{
  /*some other query*/
}
?>
  <a href="?i=<?php echo $random1;?>"> <span> Roll the dice!</span></a>

<span>Categories:&nbsp;</span> 
<select name="cat_area" >
<option value="all">All</option>
<option value="all">One</option>
<option value="all">Two</option>
<option value="all">three</option>
</select>

My problem is: When I click roll the dice, it knows the value of i but how to send the value of one of the ‘options’ from the select box along with the i. I am a newbie in php. Tell me if I am going wrong in using wrong kind of input for this.

  • 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-05-28T19:12:14+00:00Added an answer on May 28, 2026 at 7:12 pm

    First of all, you currently have the same value for each option, so you won’t be able to tell which they selected anyway.

    <select name="cat_area" >
        <option value="all">All</option>
        <option value="one">One</option>
        <option value="two">Two</option>
        <option value="three">three</option>
    </select>
    

    You will also want to add the random i as a hidden field.

    <input type="hidden" name="i" value="<?php echo $random1;?>" />
    

    Are you happy with how to create forms?

    If you specifically want it to be an <a link then you’re going to need a onChange type Javascript function on the select to modify the link. Does it need to be a link?

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

Sidebar

Related Questions

I randomly get a row from a mysql-database using php (ugly random, I know).
I'm using a php script to randomly show images. I've duplicated this script three
Playing around with generating text randomly with each page refresh using php. Is there
Using MySQL and PHP. I'm trying to select 4 random ads from a table.
I'm trying to wrtie a facebook application that generates random quotes using php. However,
Further to my previous question about salted passwords in PHP/MySQL , I have another
Possible Duplicate: Any way to specify optional parameter values in PHP? just randomly came
I'm trying to make a header image change randomly based on a random number
I've got a PHP page, with FedEx & UPS tracking numbers in a MySQL
Given a randomly generated string, how do I convert it to make it URL

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.