Comparison form

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
DeeZee
Forum Newbie
Posts: 3
Joined: Wed Jul 20, 2005 2:28 pm

Comparison form

Post by DeeZee »

I'm a total n00b, so please ... :lol:
I'm planning to build a comparison for like the one seen here or just two drop down menus with "compare it" button

I do not know what I'm looking for or where can i get a tutorial for this so could someone point me out, please ?
Thanks in advance...
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

what you need to do is create an array for your checkboxes then select off of the db for the items that were selected.

all of the item info will need to be in the db *obviously* and then you can fetch the info for the different items selected accordingly.

ex:

Code: Select all

<?
if(isset($_POST['items'])){
  foreach($_POST['items'] as $item){
    $result = mysql_query("select * from items where id = $item")
      or die(mysql_error());
    $row = mysql_fetch_assoc($result);
    echo $row['itemname']."<br>";
    echo $row['itemdesc']; //etc
  }
}
?>
<form method="post">
<input type="checkbox" name="items[]" value="1">First Item<br>
<input type="checkbox" name="items[]" value="2">Second Item<br>
<input type="checkbox" name="items[]" value="3">Third Item<br>
</form>
DeeZee
Forum Newbie
Posts: 3
Joined: Wed Jul 20, 2005 2:28 pm

Post by DeeZee »

Thank you very much!
Can you point me to some more reading, maybe a tutorial, a guide?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

best suggestion I can make is for you to get started then return here for any questions you have as they develop.

other option would be to start googling for your answers...also check the tutorials section on this web site, you might find some helpful resources there.
DeeZee
Forum Newbie
Posts: 3
Joined: Wed Jul 20, 2005 2:28 pm

Post by DeeZee »

I was afraid your answer would be like that :lol:
Thank you anyway...
Post Reply