Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. I believe you have to do some ugly concat() stuff. Given a string like Colin "The Hand" O'Malley you need to end up with concat("Colin ", '"', "The Hand", '"', " O'Malley")and the query channel/item[title=concat("Colin ", '"', "The Hand", '"', " O'Malley")]/titleHacking something out, function escapexpath($string) { $return = array(); foreach (explode('"', $string) as $part) { $return && $return[] = "'\"'"; $return[] = '"' . $part . '"'; } if (count($return) > 1) { return "concat(" . implode(",", $return) . ")"; } else { return '"' . $string . '"'; } }
  2. How about renaming your files to include the date? Daily is YYYY-MM-DD.txt, weekly is YYYY-WW.txt, monthly is YYYY-MM.txt. What are you using these files for? Using files like this is almost never the right solution.
  3. exec() is for executing files. There is no such file as "CreateDealerCatalogDB.php?ID=123&save=1". There is one called "CreateDealerCatalogDB.php" though. Why not just include() the file normally? $get = $_GET; // save old values $_GET["ID"] = $DealerID; $_GET["save"] = 1; include $_SERVER["DOCUMENT_ROOT"] . "/CreateDealerCatalogDB.php"; $_GET = $get; // restore
  4. Close as in close, not as in it does exactly what you want. You're SELECTing and GROUPing BY the title. Presumably the video title. That's not what you want. You want the tag name. So SELECT and GROUP BY the tag name.
  5. That's word wrap.
  6. There aren't any line breaks in there. Are you talking about word wrapping now?
  7. Use nl2br, which will convert the regular \r and \n line breaks into the s HTML actually cares about.
  8. So what happened to the SQL you posted a bit earlier? That was probably going to pull video titles instead of tags but it was really close - why'd you change it?
  9. If it doesn't already have a drive letter (in Win8), run diskmgmt.msc: that will list all the hard drives and you can mount it from there.
  10. Does it work?
  11. The slow query log. It's generally disabled because it can be a bit of a performance hit but at that point you're already suffering. For the query, try connecting as root.
  12. PHP doesn't have file scopes. If you dl() an extension then the extension is loaded. Stuff before can't use it, stuff after can. But avoid dl(). If your script requires an extension then it should be specifically enabled in the php.ini, and if it doesn't require it then don't load it if it's not present.
  13. Dude. I'm sure there's just a good example somewhere out there that isn't related to porn. And next time spell out that you're linking to something NSFW. Want a page that lists all the tags? Then do that. Use a query like SELECT t.name, COUNT(*) AS count FROM tags t JOIN tags_videos tv ON t.id = tv.tag GROUP BY t.name
  14. Asking how to remove the warning is the wrong question. You should be asking how to fix the problem that's causing the warning. Which, in this case, is the same thing because session_start() simply is not working for you. You can't use it if you've outputted anything. Rearrange your code so that you call session_start() as close to the beginning of the script as possible.
  15. Cron runs commands at certain times. It's very flexible in how it does so but that's it in a nutshell. Then you just make a PHP script. You can't use web-specific stuff like the REMOTE_ADDR, and the DOCUMENT_ROOT might not be what you expect, but it's all just PHP.
  16. Okay... header('location:../artikeldetail.php?msg=86&articleid='.$aid'&userid='.$uid);Look at that. You're missing a bit of punctuation.
  17. Don't include it yourself. Because that's what's happening. They aren't added automatically.
  18. My favorite source doesn't say anything either. I'd go with application/octet-stream.
  19. Assuming you exit; or die; immediately after the header(), you're redirecting to one version but arriving at another. There must be another redirection somewhere.
  20. Cookies were originally designed (unintentionally) so that it's not possible: www.qip.gr cannot set a cookie for "qip.gr", and while it can set one for ".qip.gr" the no-subdomain site couldn't read that. Force one or the other on your site - don't allow both. Which is a best practice anyways.
  21. Meaning defined at the class (trait) level. Defining them in methods is fine. trait Counter { private static $c = 0; public function inc() { $this->c++; echo $this->c, "\n"; } }
  22. Cron. It's not that complicated really: you add an entry to cron telling it to run a script (from the command line) every once in a while, like every five minutes, and that script does whatever it wants to do. Like process all notifications it should send out at that time.
  23. That's what the .htaccess does.
  24. Reconfiguring their servers to make them more secure is not "screwing you". You have code likeinclude("http://www.thefastesthorse.com/syndication/folder1/top1.html");That's incorrect. Never, ever include() URLs. Especially when they only contain HTML. Instead doreadfile($_SERVER["DOCUMENT_ROOT"] . "/syndication/folder1/top1.html");That will output a] the file as it exists on the machine, rather than as a location on the Internet and b] without trying to treat the file as PHP code, which it is not.
  25. There should be some output of some kind. If not then you may have a parse error somewhere, but if it's in that code then I don't see it.
×
×
  • 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.