954,606 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

need help with website..

Hi I was wondering if someone could help me with a code for my website? Basically what I want to do is have a drop down list that is essentially a matrix in the sense that picking one option leads to another and eventually you can narrow down the results and find what you're looking for.

for example if i was searching for cars:

what type of car: honda, ford, etc
what colour: red, blue, green etc
what year: 1999,2000 etc
price: under 5000, etc

and eventually these choices would lead to different results based on what the users input was. If I am posting in the wrong section I am sorry as I am new here and this seemed a good fit...thanks I appreciate any help I can get as I am a novice who has a website!

scottyg13
Newbie Poster
8 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

You have to use javascript, php, mysql and ajax. What level you having knowledge on those parts and try to show your code what you have tried?

rajarajan07
Nearly a Posting Virtuoso
1,447 posts since May 2008
Reputation Points: 167
Solved Threads: 239
 

You also may use Flash which gives you a simple manner of doing it!
There's also many web sites which automatically create HTML menus for you. It's simple to find it, just google it.

joao_pimentel
Newbie Poster
8 posts since Aug 2010
Reputation Points: 10
Solved Threads: 1
 

thank you both for replying, I was wondering if that is what it is called - HTML menu? Then I believe I can google search it and find a quick template to add onto my website.

scottyg13
Newbie Poster
8 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

If none of the following options are dependent of the choice of the former one then you don't need JavaScript, you can simply have several dropdownlists :)

<select name="make">
   <option value="ford">Ford</option>
   <option value="volvo">Volvo</option>
   <option value="saab">Saab</option>
</select>
<select name="colour">
   <option value="red">Red</option>
   <option value="green">Green</option>
   <option value="blue">Blue</option>
</select>
<select name="year">
   <option value="1990">1990</option>
   <option value="1989">1989</option>
   <option value="1988">1988</option>
</select>

//etc.


Check this site to learn more about the dropdownlist (html select-element): http://www.w3schools.com/tags/tag_select.asp

Then you just use a simple php-script to get the values from these elements and load the content depending on the user's inputs.

$make = mysql_real_escape_string($_POST['make']);
$colour = mysql_real_escape_string($_POST['colour']);
$year = mysql_real_escape_string($_POST['year']);

$result = mysql_query("SELECT * FROM cars WHERE make='$make' AND colour='$colour' AND year='$year') or die(mysql_error());


I hope this was helpful!

gunnarflax
Junior Poster
164 posts since Jan 2010
Reputation Points: 10
Solved Threads: 10
 

If your problem has been solved, please also mark the thread as solved :)

gunnarflax
Junior Poster
164 posts since Jan 2010
Reputation Points: 10
Solved Threads: 10
 

A good resource that will give you examples, tutorials and reference pages is www.w3schools.com .

You can get a much better idea of the different methods available.

macgurl70
Junior Poster
126 posts since Jul 2010
Reputation Points: 23
Solved Threads: 13
 
You also may use Flash which gives you a simple manner of doing it! There's also many web sites which automatically create HTML menus for you. It's simple to find it, just google it.

Yes, you're right! Whatever he is asking for I think flash can solve this problem easily. But still if anyone is not so familiar with flash design, action scripts other HTML options are also there to solve it.

kar123
Newbie Poster
6 posts since Aug 2010
Reputation Points: 10
Solved Threads: 2
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: