Jump to content

matfish

Members
  • Posts

    242
  • Joined

  • Last visited

Everything posted by matfish

  1. Hi, Im having to do a bit of string manipulation and with the given values I need help trying to find out the last day of the month... Im passing the date format of: yyyymm (200706 being this month)(and im unable to change this for several reasons) and Im using substr to find the first 4 chars as the year and the last 2 chars of the month. With these two values I need to find the last day of the month (in this case last day of this month would be 30) At the end I then do an sql query where timestamp>=yyyy-mm-01 AND timestamp<=yyyy-mm-dd (where dd is the last day of the month value im trying to find.) Any ideas with the above issue? Many thanks!
  2. Hi, Should I use htmlentities when inserting text into a 'text' field or should I leave the input and htmlentities the output when displaying? Pound signs etc work, but having issues with & (&) and trying to strip_tag at the same time? Any help would be appreciated. Thanks
  3. Many thanks SELECT userID, COUNT(userID) as total FROM comments GROUP BY userID ORDER BY total DESC LIMIT 1 worked a treat. Thanks both
  4. Hey, thanks for the replies. Daniel0's suggestions work - thank you, but didnt fancy a table just to increment a number. I will do this suggestion if I get stuck. I do have a registered date (timestamp) - is it the same thing as order by registered_date DESC LIMIT 1? Just implemeting the userID thingy... Thanks again
  5. Hi, I was wondering if anyone could help me with the following: * Got a table of members and trying to get the last user who registered. Would this be the last userID as this is an auto_increment or I do have a registered field which is a timestamp but how to find the latest date? * I want to find the member who has posted the most comments? Dont know where to start with this one. How would you like distinct the usernames in the comments table and bring back the highest count? Any help would be appreciated. Thanks
  6. Not an issue as such, just a little confused in the way Im trying to make it work. A simple table with a list of words and/or usernames, trying to search with the first letter 'a'? LIKE '%a'? or LIKE '%a%' (this list most results)
  7. Mainewoods, this worked a treat in all browsers. Many thanks
  8. Am I mixing up php with JS? You mean I do not need the $id (just id)? Putting in the whole image path didt make any difference. Dont understand why it works with FF/IE7 but not IE6/5
  9. Hi, Iv got the below code when clicking on an image in a list it changes the background of a div to that image. It simply uses numbers to identify the images, This works fine in FF and IE7, but not IE6 which Im testing: function change_image($id){ document.getElementById('pic_border').style.backgroundImage='url(image_assets/image'+$id+'.jpg)'; } Any ideas why this may not work in IE6- Many thanks
  10. Hi, thanks for the replies. I did a bodge job and rather than hiding/showing the div, I resized it to show/hide and this works. Like this: function show_images(){ //document.getElementById('img_list').style.display='block'; document.getElementById('img_list').style.height='130px'; document.getElementById('motioncontainer').style.height='95px'; document.getElementById('motiongallery').style.height='95px'; document.getElementById('hide_more_images').style.display='block'; document.getElementById('img_desc').style.display='block'; } function hide_images(){ //document.getElementById("img_list").style.display='none'; document.getElementById('img_list').style.height='0px'; document.getElementById('motioncontainer').style.height='0px'; document.getElementById('motiongallery').style.height='0px'; document.getElementById('hide_more_images').style.display='none'; document.getElementById('img_desc').style.display='none'; } Iv got another JS issue but ill post when ready in appropriate section. Thanks again.
  11. Sorry to bump - any ideas anyone? Many thanks
  12. The site is under development and password protected - I can open up for you to view source but didnt want everyone mocking the site.
  13. The div im trying to show/hide is the id="img_list" <div class="top_right_image_space" id="img_list"> <div id="motioncontainer"> <div id="motiongallery"> <nobr id="trueContainer"> <a href="javascript:void(0);" onclick="javascript:change_image('1');"> <img src="image_assets/thumb_image1.jpg" border="1" alt="1"></a> <a href="javascript:void(0);" onclick="javascript:change_image('2');"> <img src="image_assets/thumb_image2.jpg" border="1" alt="2"></a> </nobr> </div> </div> <div class="hide_more_images"> <a href="javascript:void(0);" onclick="javascript:hide_images();" class="hide_link">[X]</a> </div> </div> But when its shown again the contents within has disappeared. This only happening in IE. Many thanks
  14. Hi, the code you provided is just a neater way of what I did - thanks - but I still get the issue of the contents within the DIV are not displayed when I toggle the show/hide link. I do have 3/4 div's within this 1 div Im toggling - would this cause an issue? Thanks for your replies.
  15. Hi, my javascript skills are not as good as my php but ill address the issue. Iv got a simple show/hide div (display:none; display:block; kinda thing). Onload its shown, and the content within is displayed. but then i hide it, but when i click the link to display it again the content within is gone? But this is only happening in IE, FF works no probs. Any ideas why is does this? JS: function show_images(){ document.getElementById('img_list').style.display='block'; } function hide_images(){ document.getElementById("img_list").style.display="none"; }
  16. Thank you both. I thought this would be an Ajax thing but javascript seemed to handle it: <html> <head> <script type="text/javascript"> //Example to show 2 iframes, which the google iframe is being refreshed on its own var reloadInterval = 3000; function init() { setTimeout('reload()',reloadInterval); } function reload() { var iframe = document.getElementById('window1'); if (!iframe) return false; iframe.src = iframe.src; setTimeout('reload()',reloadInterval); } window.onload = init; </script> </head> <body> <iframe id="window1" width="500" height="400" src="http://www.google.com/"/></iframe> <iframe id="window2" width="500" height="400" src="http://www.yahoo.com/"/></iframe> </body> </html>
  17. Hi, Iv got a simple standard page (html) with a few iframes which pulls in different stats (its a work related thing). I want to update one of the iframes only. Putting a meta refresh within that one iframe still reloads the whole page. Im new to Ajax, anyone know of how to refresh one 1 iframe on a timer? Many thanks
  18. Hi, Trying to read a local text file (C:\windows or from the local network) so I can then pass that txt file though a ticker (sortof marquee) Any ideas or point me in the right direction? Many thanks
  19. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"http://www.domain.com/dir/include_file.php"); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); $result=curl_exec ($ch); curl_close ($ch); echo $result; the above doesnt work either but doesnt show any errors, does this mean curl is not installed on the host? Will take a week to get a reply from them!
  20. Hi, thanks for the reply. I get: Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in [location of file] on line 17 Warning: fsockopen() [function.fsockopen]: unable to connect to [file location].php:80 in [header location] on line 17 Success (0) You think my hosts may not be allowing the connection? Thanks again
  21. Hi, How can I include a .php file which is located on a different server/host? include_once("http://www.domain.com/dir/include_this.php"); The above gives: failed to open stream: Connection refused in...blah blah Trying to use one file over several sites
  22. Hi, Iv been recording x,y,url,datetime on javascript clicks on my site. I now want to show like a heatmap overlay (like http://blog.corunet.com/english/the-definitive-heatmap) however I know nothing about Ruby. Anyone used the above click tracking method or know of how to pin point pixels over the top of a given page like the above mention link? Any help would be appreciated.
  23. Many thanks for your reply. The examples in the links you have supplied are what I have been using anyway. Thanks again.
×
×
  • 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.