Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. insert into site_users (name, username, password, email, joined) values (select name, username, password, email, joined from site_users_new where id = 10)
  2. I did find a window that looks like it could be two people doing it. I don't think that's what it really is, but still... tallest building. If you look at street level there's a white SUV next to 2 red box looking things. Follow that straight up, right above the ground level store or whatever.
  3. def looks like shorts and shirt to me.
  4. the short answer is that it for instance turns 5.1 into 5.10
  5. Lies! I did find Waldo though.
  6. eric owns it, but i pwn it. As far as promotions...if by that you mean marketing ourselves, SEO, etc...afaik we don't do any of that. We just grow because we're that damn cool. Well, I am, anyways.
  7. <?php $varPrevHeight = 5.2; // example for ($f = 4; $f <= 6; $f++) { for ($fi = $f; $fi < ($f+.11); $fi += .01) { if ($fi == 6.06) break; $fi = sprintf("%01.2f", $fi); $t = explode('.',$fi); $value = $t[0] . (($t[1] && $t[1] > 0)? '.' . ltrim($t[1],'0') : ''); $option = $t[0] . 'ft' . (($t[1] && $t[1] > 0)? ' ' . ltrim($t[1],'0') . 'in' : ''); $selected = ($value == $varPrevHeight)? " selected='selected'" : ""; echo "<option value='$value'$selected>$option</option>"; } }
  8. Hate to burst your bubble MadTechie, but your regex will return true if the first and/or last node is greater than 255 and also it will validate if there are 4+ nodes. I nonetheless did a benchmark, rigging it to always be a valid IP address and never be a valid IP address. This function for all intents and purposes validates at worst, same speed as your pattern, at best, twice as fast (this function will return a false up to twice as fast as your regex). Suppose it's not really fair comparing it to a broken regex, but I have a sneaking suspicion any regex you throw at it will give about the same results, with all the alternation that must inevitably be used... function isValidIP($ip) { $ip = explode('.',$ip); if (count($ip) != 4) return false; foreach ($ip as $node) { if (($node > 255) || ($node < 0) || !is_numeric($node)) return false; } return true; }
  9. I interpreted the part in red as "when". But even still, a column with timestamp (or a date type column acting in same principle) would act as your incremented column just the same.
  10. Google Site search is pretty solid. You also get the added benefit of it reporting back to google, if you're interested in stuff like SEO.
  11. Because you can't use readfile on some file from another server. Would you like it if I could just readfile anything on your server? Get all your server-side code, etc...? If you are wanting to send it through headers like that then you need to have your server access the file directly, through ftp for example.
  12. personally I would use [CITYNAME] in the text and preg_replace it. Much cleaner than eval. edit: I guess str_replace would be better than preg since its exact string search.
  13. Well I posted my take already, see the bolded red: Ordering by the "id" (I assume this is where you mean to have the primary key, or at least some kind of globally incremented value) would show the most recent one entered, but it would not tell you when it was entered. Sure, when you're selecting *, all those date fields will be selected, so he will have that info, but the point is, if his goal is to find the most recent entry, ordering by some "id" is not necessary. Just order by the column that constitutes having the "most recent date" (I'm assuming it's the `Date` column he has).
  14. I assumed he meant most recent entry for the CustID, not the most recently added row to the table.
  15. I don't really see how adding a primary key would help out here...if you're thinking to order by highest key..well he's already filtering by CustID and really what's the difference between ordering by a primary key vs. the date he's already tracking?
  16. assuming 'Date' is what constitutes having the "most recent": select * from ActivityLog where CustID = '$custID' order by `Date` desc limit 1 notice the backticks on `Date`. That's because date is a reserved word. If you want to make a column name a reserved word, you must put backticks around it. Also, that only works in mysql. So it's not going to work in some other database. I suggest you change that column name to something else, as it's bad programming to use reserved words for things.
  17. getenv only works on apache servers. So if you are using IIS it won't work. Use $_SERVER['REMOTE_ADDR'] instead, as it works across different servers.
  18. Pretty much all of the forums outside of php help are there more as a matter of filtering out questions from php help, than actually being there to provide services for them... I mean sure, sql questions etc.. do come up a lot, because they tie in closely to php, but we're a php specific community, not a devshed type place that likes to focus on everything. We don't even post things on the main site (tutorials, etc..) unless there's some kind of php involved. For instance, we would put up an ajax tutorial if php is used as the backend, but you will probably not find a strictly js tutorial on this site. Point of all that is we aren't really interested in being a comprehensive "everything programming related" site; we focus on php and as a courtesy, semi-cater to stuff that interacts with it.
  19. It's not that we don't appreciate it, but seriously, it's as if you sit there 24/7 constantly hitting the refresh button, trying to get a report in, before anybody has a chance to find it on their own. It's not like we aren't doing our jobs... so constantly seeing report, report, report, literally 10s after something is posted, gets kind of annoying. You might take offense to that, but I'm just keeping it real...sometimes it just seems like you don't think anybody is doing anything unless its reported, and that's not true, so there's no need to get trigger happy about it.
  20. i count 3 ( in your initial if statement, but only 2 ). Come on man, syntax errors are not exactly rocket science...
  21. okay, the problem with php is that php parses everything and then sends the output (if any) back to the client. So, it is not a "real-time" scripting language. But there are some tricks you can do to fake it, depending on your needs. One trick is flushing what's currently in the output buffer to the browser before the script is done processing. You can do that by echoing whatever message you want, then using ob_flush, then send out the emails. So the message will display before the script is actually done sending emails.
  22. problem is the line before it is missing a ; it helps if you actually post what the error is (or you know, actually read the error).
  23. You can echo out a "loading" or "processing" message and use ob_flush to send it to the browser before the script is done executing. Or you could use js/ajax to send the form info bits at a time, displaying progress bar or whatever, as each batch gets sent.
  24. how about posting how you tried to implement that solution.
  25. I would suggest using proper flash object/param/embed html. different browsers load it up differently. Google imbedding swf.
×
×
  • 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.