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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:14:31+00:00 2026-06-03T14:14:31+00:00

I have posted this a few times looking for some help, I cant seem

  • 0

I have posted this a few times looking for some help, I cant seem to work out why i dont get any data from my dynamic drop down but i do from the 2 static fields. I did get some answers but mainly saying that i need to sort out the security, which i hope to learn next before anything is live online, everything looks good in Firebug including the trace for the http request, i think its a problem with the query i am trying to run, i will post this again and see if anyone can help me out before i address the security flaws.

Thanks alot for helping me out.

first is html, the subcategory is the problem, all items are stored in a javascript array and works fine, just not the query

<select name="Category" id="Category" 
onchange="javascript: dropdownlist(this.options[this.selectedIndex].value);">
<option value="">Select Category</option>

<select name="subcategory" id="subcategory">
<option value="">Select Sub-Category</option>
</select>

<script>

$(function() {
  $('#subcategory').change(function() {
        $('#subcategory').load('results.php', {value: $(this).val()});
  });
});

</script>

 $category=$_POST['Category'];
 $subcategory=$_POST['Subcategory'];
 $destination=$_POST['Destination'];


 $result = mysql_query("SELECT * FROM travel WHERE Category='$category' 
 AND Subcategory='$subcategory' AND Destination='$destination'")
 or die(mysql_error());


 $row = mysql_fetch_assoc( $result ) ;

echo to table (not posted as is working ok)

  • 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-03T14:14:33+00:00Added an answer on June 3, 2026 at 2:14 pm

    Where to even start? Your field name is ‘subcategory’. You pass ‘value’ to results.php and you’re attempting to retrieve ‘Subcategory’ form the $_POST array. You need to line all these names up.

    I’m not sure whether the PHP there is the code for results.php or for whatever script the form is posted to, or are they the same? Regardless, whatever results.php needs, you need to include in the data you pass to load. For example, since you currently use ‘value’, you’d retrieve that via $_POST['value'], not $_POST['Subcategory'].

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

Sidebar

Related Questions

I've seen this posted a few times, but I wasn't able to get the
im sorry if this was posted already i have been looking to no avail..
I posted a thread about this earlier and have made some progress but now
[I have posted this at the Django users | Google Groups also.] Using the
So I just have posted a question about this code (which was answered): $(document).ready(Main);
This sounds like a problem many others have posted about, but there's a nuance
I little while back I posted this question . I have updated that question
I have already posted a question about this, but the situation has changed sufficiently
I'm asking this question because I have gone through the tutorial posted here: Preventing
This should be really simple, but I have tried many solutions posted on 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.