Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. HTML has a "maxlength" attribute you should look into. If you don't want the user to be able to change it at all, an input is perhaps not the best way to go. You could setup a bit of JavaScript on the element though to make it default back to a value when the user loosees focus on the input (onblur): <input (...) onblur="this.value='EUF';" />
  2. What 'great shape' do you mean exactly? Personally I don't even like the look of that site to be honest. Excluding "YUI" there's no references in the source though to any 'tools' being used to create the site, which makes it pretty much impossible to know without asking the author. Not sure this is worthy of the JavaScript forum...
  3. according to many sites I find online, they say that this speeds it up. I feel it does this because it doesn't have to create a cached image thumb, which I think is created every time the folder loads. Then it makes it so while the folder is open images don't have to refresh when you scroll past them then scroll back to them. Loading the images into a cache file every time the folder loads, would surely defeat the object of a cache file?
  4. Ah yes my mistake, missed the * or +!
  5. If I tell you, can I have free membership?
  6. This will return an array off all the values within quotes: preg_match_all('/"[^"]"/', $str, $matches); print_r($matches);
  7. Cron - millions of tutorials on how to use it.
  8. Just thought... I don't know what you plan on doing when the path has a leading slash, but to prevent them from having two slashes when you add 'http://example.com/' to the front of it, change the regex slightly to: src="\/?(...) - if you get me?
  9. Try this... <?php $content = 'src="lalala.html" ..efwef943434knrg src="http://lelelele.html" werfer4m34/rg5tkrwe3 src="lululul.html"'; $domain = 'http://example.com/'; $content = preg_replace('/src="(?!http:\/\/)([^"]+)"/', 'src="' . $domain . '$1"', $content); print $content; ?>
  10. Not on small queries, but when you're talking a couple of million rows there's probably going to be a difference. The greatest of the work is done fetching the data and not entering it into the array(s). 95% of the time I use mysql_fetch_assoc() simply because it makes the code more readable, but there is the odd time where you may need to use mysql_fetch_array(), just base the choice on the situation.
  11. Would save yourself a lot of time if you actually read people's responses.
  12. Hi all. I'm fairly new to MSSQL (but not MySQL) and having a few troubles selecting records from a certain date. I've currently got: select t1.order_create_date, t1.orderno, t1.prodcode, t2.invcost, t1.qtyord, t1.curcost from iuk_ord_detail t1, iuk_ord_hd t2 where t1.salesno = '898' and t1.orderno = t2.orderno This works perfect. Now though like I said, I'd like to only select records from a certain date, going by the "order_create_date" field which is 'datetime' data type. I've tried adding (for example): and order_create_date = '05 May, 2009' But this returns 0 records, even though there is at least 1 record with the value of "2008-05-20 15:51:00.000". I don't suppose anybody has any clue why not? EDIT: I managed to get it working when I use: t1.order_create_date between '2008-05-20 00:00:00.000' and '2008-05-20 23:59:59.000' ... but I'd prefer to have a 'date = _date_' kind of solution if possible. Thanks for any help, Adam
  13. I agree with the Axeia's points. About the yellow links, the yellow gradient background looks kinda odd half way through as well, like it's a browser error or something. Personally I do think it's a little too bright, try changing the page background to white and using the current color as maybe a border around the other orange/red background? Obviously the 'page will be ready soon' pop up will eventually go but it's very annoying!
  14. I don't like it I'm afraid, it's very bland and monocharamatic. I don't really understand what it's a CMS for? The whole thing looks like a forum. The main content for each page doesn't look thought out or filling. The form inputs are backwards on certain pages? If you login to the admin panel, go back to the homepage, then back to the admin panel you have to log in again. Your logo breaks the laws of physics. Your XHTML and CSS don't validate! Also a note on security, although I know this isn't the BETA test forum, you can upload ANY file using your avatar uploader! For example, look what I uploaded: http://vucms.uni.cc/avatars/91070phpinfo.php Obviously this is incredibly insecure should someone gain access to the admin panel. I've not tested anything else but I dare say if this is possible then you'll have a lot more holes in your system. Read up on PHP security! To be honest pal I don't think many, if any, will buy this - simply down to the flaws I mentioned and lack of features.
  15. If you're using Apache: http://www.askapache.com/htaccess/using-http-headers-with-htaccess.html#prevent-caching-with-htaccess You may also want to take a look at: http://www.mnot.net/cache_docs/
  16. You need to escape your single quotes. How exactly are you returning the string which contains the cms tags? EDIT: Excellent!
  17. The last example I sent you works.
  18. Oh sorry I see. Try this: preg_match_all('/\{cms[^\}]*name="[^"]+"[^\}]*\}([^\{]+)\{\/cms\}/', $str, $matches); print_r($matches); Let me know if this is what you're after...
  19. The regular expressions is right, it's just modifying the function a little bit now to return the matches. preg_match_all('/\{cms[^\}]*name="[^"]+"[^\}]*\}[^\{]+\{\/cms\}/', $str, $matches); print_r($matches); The $matches array will contain what you're after...
  20. Give this a try... preg_match('/\{cms[^\}]*name="[^"]+"[^\}]*\}[^\{]+\{\/cms\}/', $str);
  21. Always read the manual! Take a look at example 4 for the mail function: http://uk2.php.net/manual/en/function.mail.php
  22. die() is a function that simply kills the script and optionally outputs a message - it's very useful for debugging. The idea behind foo is you can then go "Ctrl + F" type in 'foo' and you'll find the output of the variable when you run the script. $var_name was just an example though, go through your variables, think about what the output should be and then check the output when you run the script. If it's not what you expect, or it's blank, you've probably found your problem. PHP Debugging Tips. Good luck!
  23. The "currentpage" var looks to be getting passed along to the pages just fine, so does the "find" var. You need to DEBUG your script!
  24. What does the error console say when you try to run the function?
  25. At a quick glance, is there definitely records on the next pages? For your loop you seem to be manually setting the "$range" variable you use to 3 - although I don't full understand the logic behind that loop it would seem it will display several pages even if there isn't any. Try the debugging as well..
×
×
  • 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.