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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:04:14+00:00 2026-05-25T18:04:14+00:00

I’m using $intVariable=(int)$_GET[var1]; to output and select a variable in mysql records i.e /myfile.php?cat=5

  • 0

I’m using $intVariable=(int)$_GET[var1];

to output and select a variable in mysql records i.e /myfile.php?cat=5 selects different results.

I am dealing with a dropdown from SQL so need to output a list based on selected ID’s.. so I need to have something like /myfile.php?var1=X&var2=Y

I’m actually using a bit of JavaScript too, so unsure whether it’s PHP or JS I need to adjust to grab another variable.

This code + some PHP currently outputs the selected ID of my selection in the title bar..

    function reload(form)
    {
    var val=form.cat.options[form.cat.options.selectedIndex].value;
    self.location='myfile.php?var1=' + val ;
    }

How do I achieve this multi tier structure getting 2 variables from the title, so I can use multiple variable to assign in my MYSQL selects. have tier dropdown lists

  • 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-25T18:04:15+00:00Added an answer on May 25, 2026 at 6:04 pm

    Not really sure what exact answer your looking for, but to fix your function to add more vars:

    function reload(form)
        {
        var val=form.cat.options[form.cat.options.selectedIndex].value;
        self.location='myfile.php?var1=' + val + '&var2=' + val2;
        }
    

    In general:

    what your setting there is the GET parameters in the URL, so for example to set the variables “name” and “age” you would do:

    http://www.example.com?name=bob&age=17
    

    Where name is bob and age is 17

    The other way people do it is through html arrays, so:

    http://www.example.com?people[]=bob&people[]=fred
    

    On the php side, $_GET[‘people’] will return an array with the two strings bob and fred.

    If your using javascript to construct the url, you need to js to create a url like the one above, I’m guessing it should return

    self.location='myfile.php?var1='+val+'&var2='+val2
    

    When your reloading the form, to retain the selected drop down, you need to do one of two things

    JS: Recommended

    $('#mySelect').val(val2)
    

    or in the php

    if($optionvalue == $val2){$selected = "selected"}
    echo "<option value=\"$optionvalue\" $selected>myoption</option>"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have thousands of HTML files to process using Groovy/Java and I need to

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.