Jump to content

JustLikeIcarus

Members
  • Posts

    430
  • Joined

  • Last visited

Everything posted by JustLikeIcarus

  1. The "^" character basically means "Starting With" in this context. Thats why "Bir" would pass and "day" would fail in your example.
  2. Well if you always want to show the one you click and the next one after you would do like $(this).show().next().show(). More information on when you want items to be shown is needed to better understand what your trying to do.
  3. Take a look at using jQuery and Mike Alsup's awesome form plugin http://www.malsup.com/jquery/form/
  4. I basically do this exact thing returning all answers combined in one result using GROUP_CONCAT(). Basically I do select questions.question, GROUP_CONCAT(answers.answer) FROM questions, answers WHERE answers.answer_questionID = questions.question_id GROUP BY questions.question Obviously you would need to replace questions.question and answers.answer with your column name.
  5. You could do $('#test .ulError'). or $('#test').find('.ulError') Both should return the element you want.
  6. You could try something along the lines of this. Which would enable you to come back and add in a where clause. Also this only requires reading in the table once. Select sum(if(DATEDIFF(Release, Arrival ) < 0, 1, 0)) as less0, sum(if(DATEDIFF(Release, Arrival ) = 0, 1, 0)) as 0day, sum(if(DATEDIFF(Release, Arrival ) BETWEEN 1 and 5, 1, 0)) as 1to5, sum(if(DATEDIFF(Release, Arrival ) BETWEEN 6 and 10, 1, 0)) as 6to10 FROM table
  7. You need to add a '#' to your selector. Try it like this. <script type="text/javascript"> $(document).ready( function() { var items = ['regular', 'outsource', 'total_headcount', 'internal', 'external', 'resigned', 'eligible', 'member', 'valoptec_percent']; $.each(items, function() { totalIt('#'.this); }); } );
  8. Woops left out a closing parenthesis $(document).ready(function() { filecheck(); }); function filecheck(){ var randomnumber=Math.floor(Math.random()*11) $.get('scripts/filecheck.php', {rand: randomnumber}, function(data) { if (data == "Success!"){ alert ("The photo has been successfully uploaded to the site. Click OK to enter details for photo"); window.location="index.php?locate=upload&filedone=yes"; } }); setTimeout('filecheck()', 2000); } What i meant is that in your original code you we setting the contents of #Davfilecheck to what the php file check was returning. In this version I didnt do that.
  9. Try it this way. The random number is needed because IE likes to cache pages it "thinks" are the same. Also I didnt set the inner html of the div. But that can be done by adding $('#Davfilecheck').html(data); to the function. $(document).ready(function() { filecheck(); }); function filecheck(){ var randomnumber=Math.floor(Math.random()*11) $.get('scripts/filecheck.php', {rand: randomnumber}, function(data) { if (data == "Success!"){ alert ("The photo has been successfully uploaded to the site. Click OK to enter details for photo"); window.location="index.php?locate=upload&filedone=yes"; } }; setTimeout('filecheck()', 2000); }
  10. One issue is that your javascript is hard-coded to 'tbl' as the id so you will need to make it so its dynamic. Try changing your table ids to something like "tbl1", "tbl2" and modify your checkbox function to send the id of the table whos rows you want to hide. In your php just increment a counter to name your tables like $i = 0; while($row=mysql_fetch_assoc($result)){ $bgcolor="#f1f1f1"; echo "<TABLE width=50% align=center cellpadding=0 cellspacing=0 id='tbl$i' summary='demonstration'> <tr>"; echo "<td bgcolor='dfdfdf' ><font face='arial,verdana,helvetica' color='#000000' size='3'>blah blah</font></td>"; echo "<td bgcolor='C0C0C0' ><font face='arial,verdana,helvetica' color='#FF0000' size='4'>" . $row['AB'] ."</font></td></tr>"; echo "<tr><td bgcolor='dfdfdf' ><font face='arial,verdana,helvetica' color='#000000' size='3'>blah blah</font></td>"; echo "<td bgcolor='dfdfdf'> <font face='arial,verdana,helvetica' color='#0080C0' size='2'>". $row['TR'] ."</font></td></tr>"; echo "<tr><td bgcolor='dfdfdf' ><font face='arial,verdana,helvetica' color='#000000' size='3'>blah blah</font></td>"; echo "<td bgcolor='dfdfdf' id='cb0'> <font face='arial,verdana,helvetica' color='#000000' size='3'>". $row['ML'] ."</font></td></tr>"; $i++; }
  11. I started using Cufon instead. http://wiki.github.com/sorccu/cufon/usage Give it a try doesnt use flash.
  12. First I would remove the space from your id attribute. Make it box_info or something. Then for the jQuery... $('#box_info:not(:has(li))').hide();
  13. You cant have multiple elements with the same "id" attribute. Looks like all your tables have an id of "tbl" this will break getElementById
  14. Im a big fan of the 960 grid system for layouts. Take a look at http://960.gs/ you may like it.
  15. Well your best solution would be to setup replication. This requires you to enable binary logging for the database. A how-to guide is here http://dev.mysql.com/doc/refman/5.0/en/replication-howto.html
  16. If you also want to display an error if the user doesnt own the tracker you may find it a better solution to first do select count(*) as cnt from trackers where id = ? and uid = ? then using the result of that query if ($count == 1){ //run your delete }else{ //return your error }
  17. Take a look at php's ftp functions. They should be able to do what you want.
  18. browsershots.org may be better for you
  19. Yeah that should do exactly what you want.
  20. One of the nicest implementations of this i've seen is http://arshaw.com/fullcalendar/ I believe it includes an example php script for sending the months events back as a JSON object.
  21. Im guessing that to insure the functionality you want is available across all browsers then you need to use the plugin. click by itself wont work because the click isnt triggered untill mouseup I dont believe. And I believe webkit browsers dont send mousedown the same as others. So your best bet is the plugin.
  22. Ok so im assuming you have a normal page submit button plus one for showing these elements right? The submit function your getting is from the button element being pressed. If your using input type="submit" for the submit button then just change that js to $(document).ready(function () { $('button').click(function(e){ $('.show:hidden:first').show(); return false; }); }); That will keep button elements from submitting the page. You can also give the button an id and change the jquery selector to that id instead of button.
  23. No get is actually worse because you dont have to submit a form to send a get var. You can continue to use post but I would perform checks on the post variables to verify they contain what you want. At the very least you should pass the variables into mysql_real_escape_string http://us3.php.net/mysql_real_escape_string
  24. First its important to know that multiple elements can not have the same "id" attribute. Change your id="show" to class="show" to correct that problem. Once thats changed, remove the display:none from the input elements and just hide the whole div, then try this jquery: $('button').click(function(e){ $('.show:hidden:first').show(); });
  25. It returns the autoincrement id of the last insert that occured for the session. your code should read mysql_query("INSERT INTO customer ( title, name, housenumber, add1, add2, pc, email, tel) VALUES ('$_POST[title]','$_POST[customer_name]','$_POST[customer_house_number]','$_POST[customer_road_name]', '$_POST[customer_city]', '$_POST[customer_postcode]', '$_POST[email]', '$_POST[c_tel]' )") or die('Error: ' . mysql_error()); mysql_query("INSERT INTO services (cid, number_of_owners, owner_name, house_number, road_name, city, county, postcode, email, nature_of_work, month, year, uptoboundary, askpermission, underpin, description) VALUES ( last_insert_id(), '$_POST[number_of_owners]', '$_POST[owner_name]', '$_POST[house_number]', '$_POST[road_name]', '$_POST[city]', '$_POST[county]', '$_POST[postcode]', '$_POST[email]', '$_POST[nature_of_work]', '$_POST[month]','$_POST[year]', '$_POST[boundry_with_neighbour]', '$_POST[ask_for_permission]','$_POST[underpin_foundations]', '$_POST[description_of_works]' )") or die('Error: ' . mysql_error()); Now a word of warning. You NEVER want to use $_POST in any sql statement. Because you have no idea what the person submitting the form has sent you.
×
×
  • 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.