Jump to content

1internet

Members
  • Posts

    136
  • Joined

  • Last visited

1internet's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. The HTML part is what I wasnt sure of Would it be something like this? <input type="checkbox" name="makes[]" value="1"> <input type="checkbox" name="makes[]" value="4"> <input type="checkbox" name="makes[]" value="7"> So it creates an array of makes[], and serializes all the ones that are checked, and passes them through as an array? Can $_POST accept the array? Then I guess I would implode the array?
  2. I have a list of checkboxes, for a filter for manufacturers. I want the checkboxes to update the search results on click, when a new manufacturer is selected or de-selected. The ajax code picks up the checked items from the form like this $('.new_make_button').click(function(){ // when a feature button is selected var serialize = $('#new_make_form').serialize(); // takes all the values of the filter $.ajax({ type : 'POST', url : '../ajax/new_makes.php', // sends the values to ajax file data : serialize, success : function(data) { $("#new_results").html(data); } }); }); I want to add all the selected manufacturer_ids into a list like (1,4,7,10), and set them in a session and run the class, with the updated session. <?php if(isset($_POST['makes'])) $_SESSION['new_results']['makes'] = $_POST['makes']; include '../classes/new-results.php'; $result = new NewResults; $_SESSION['user']['new']; return $result->results(); ?> How can I pass the manufacturer IDs of only the selected manufacturers to the ajax file through the form #new_make_form. How should the html form work to accomplish this? Or do I need to make adjustments in the ajax files? I also am not sure about what the variable for $_POST should be, I have used 'makes' as an example, but not sure how it can catch them all at once.
  3. I have considered CSS, and I don't mind using it, but couldn't see anything. @fastol, I think that might work, need to play with it a bit
  4. I want to have completely custom checkboxes and radio buttons. This would entail: 1. a text label 2. a background icon 3. a hover effect 4. an active effect 5. and a click effect I don't want any checkbox or radio icons, I just want them to look like buttons. I have been experimenting with jquery but dont seem to be able to get much further than the default styling. Any suggestions are much appreciated.
  5. What if we used a combination of both, e.g. it downloads the first 5 pages, and if a visitor tries to go further than those results it dowloads the next 5 pages of results too?
  6. I want to have my results slide out and slide in just like a carousel. So my results are 3x3, and then whenever you click next, the existing results slide out to the left, and at the same time the new results slide in from the right hand side. If this is done then would it mean I have to download all the results, so they are stored, and can thus slide in immediately, without an ajax load? Or is there some other amazing way to accomplish a task like this?
  7. Ah, thats what I thought! Thanks
  8. I want to list results that belong to a certain category. However, I have multiple categories and some results can belong to more than one cateogry. I want to a query that will show all the results from several categories, the number of categories will be aribitrary though. So I will have the categories contained within an array e.g. $cat_ids = array(12,26,32) And I want the query to be $sql = "SELECT * FROM `categories` WHERE `cat_id`=12 OR `cat_id`=26 OR `cat_id`=32"; Of course sometimes there may only be 1 category, and sometimes there could be 5. So how do you execute the array in the query? Or do I have to run a foreach loop? $sql = "SELECT * FROM `categories` WHERE" $i = 0; foreach ($cat_ids AS $cat_id){ if($i!=0) $sql = "OR " $sql = "`cat_id`=$cat_id" $i++ }
  9. Sorry, I mean the top tag when you post a topic
  10. So with the Topic Tags field just above, when i add a comma it creates a tag. How is that done? And how does it feed into the database?
  11. e.g. $q = mysql_query(SELECT * FROM `table`); <div> while($r = mysql_fetch_assoc($q)) { echo $r['name']; } </div> But how do I split that into 4 divs: <div id="1"></div><div id="2"></div><div id="3"></div><div id="4"></div>, withouth having to do 4 sepate queries?
  12. Nothing, its just returning a list of rows, but in 4 columns rather than one long list.
  13. If I wanted to display database results in 4 different columns, would that essentially mean I have to run 4 different sql queiries with each of them limited, or is there another way around that?
  14. Ok, sorry, that was just how I inferred it. On a lighter note, it works now. So thanks.
  15. I don't appreciate the sarcasm, it was a genuine question, if you don't want to help then thats fine.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.