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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:39:56+00:00 2026-05-24T01:39:56+00:00

I am getting data via $_GET[‘value’] and I want that value to represent a

  • 0

I am getting data via $_GET['value'] and I want that value to represent a variable of an array.

I’m building a sort by drop-down menu with 3 options.

I want to search an array for a match.

So if the $_GET['value'] == 'name'
then I want to search my array for 'name' and use that value as the data sent to my query.

Sort By:

<select name='1' value='name'>Name</select>
<select name='1' value='manufacturer'>Brand</select>

So when php gets the values of the select menu I want to do an array search for that name and use its value to represent a variable to be sent to my query.

  • 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-24T01:39:58+00:00Added an answer on May 24, 2026 at 1:39 am

    Determine if the value received in $_GET is in your array, then retrieve it by the index.

    // Your values are stored in this array
    $your_array = array("name" => "some name", "place" => "some place");
    
    // Check if the `value` is a key in your array
    if (array_key_exists($_GET['value'], $your_array)) {
       $search_value = $your_array[$_GET['value']];
    }
    else {
      // Not found.. Use some default value instead.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assume that I have the ItemSource bound and i am getting the data. Now
I'm making in house application that download data via xml files from external server.
We've got a large system that's loosely bound to its data source (Navision) via
Sometime back I was getting alot of data via some API and I saved
I am getting daily data dump via e-mail, which is being processed by Access
how can i getting data from listbox in second form named listform while i
I'm importing from a CSV and getting data roughly in the format { 'Field1'
What are the differences between using SqlDataAdapter vs SqlDataReader for getting data from a
I'm trying to write an import function for getting data out of an excel
I have the following situation. Im getting data from an external system in the

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.