Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. No, that's for getting the newest folder. Randomly selecting a file is as simple as getting a list of all the files and picking one.
  2. elements have onplay and onpause events you can add handlers to.
  3. If you can rely on the modification time, $dirs = glob("/path/to/folders/*", GLOB_ONLYDIR); usort($dirs, "filemtime"); $newest = end($dirs); Otherwise use usort() but with some function to compare two MM_DD_YYYY strings.
  4. Look at the $_SERVER["QUERY_STRING"]. [edit] Jessica's is better. Even though it's missing the equals sign using ?error is treated just like ?error=: $_GET["error"] == "".
  5. cURL might want a path to an actual file on the filesystem. Is the Content-Length correct? It'll be the size of the file plus the size of all the form fields, plus a lot of extra overhead because it's multipart/form-data. Try omitting it.
  6. That for loop you have there isn't doing anything, you can cut it out. Leaves you with basically the same thing you had before.
  7. Don't rely on error conditions to tell you there's duplicate data. Actually look to see if there's a duplicate entry before trying to add a new one. [edit] If you're paranoid then there are a lot of different errors you can look for. PDOStatement::errorCode() will return something that is not the MySQL error number.
  8. URL rewriting lets you move things around in the URL. It cannot just come up with information from scratch: if your read_news.php requires the ID number then it has to be somewhere in the rewritten URL. You can put the title in there too but that can be ignored. http://uaecarmarket.org/news/30-wheelsandmore-pushes-the-ferrari-ff-near-its-tuning-limits See the 30 in there? It doesn't have to be there but it does need to be somewhere. The alternative is editing read_news.php so that it can use a title, but the title has to be unique. Using an ID number is perfectly fine so I recommend you use it. So question: what do you want the URL to look like?
  9. Syntax errors are big. You should have found them during your development and testing. Advice: don't redirect. Recover from the error as best as you can (in code) and make sure it gets logged somewhere. Then you keep an eye on the logs.
  10. What ID? And yes, please post the form.
  11. "Accounting for" isn't too descriptive but I think I know what you want. ^ applies to the very beginning of the entire URL (sans query string) being matched against. If you try the first one then it'll only match when the beginning of the string is somewhere in the middle of it. Which is impossible. Thus the second one is correct. If you find that the Rule is not matching, try making the leading slash optional. Depending on where these Rules are and what else you may have with them, the slash might not be there. ^/?products/([_a-zA-Z]+)/([^/]*)$
  12. If you want everything then you may as well just brute-force it. Whether that involves recursion or a multi-dimensional array or something else depends: recursion isn't the best for this because there's only two "layers" to process (first is the 2-hour block, second is the 1-hour block), while a 2D array is okay because the output will be small enough that you don't have to worry about memory usage. Basically, $blocks = array(); foreach ($twohourblocks as $thb) { foreach ($onehourblocks as $ohb) { if ($ohb not contained in the $thb) { $blocks[] = array($thb, $ohb); } } }
  13. Yeah, I didn't because I didn't want to, not because it would be illegal. Like you saw it's GPLv2 or BSD.
  14. MySQL has the self-explanatory BETWEEN...AND operator. `date` BETWEEN 'YYYY-MM-DD' AND 'YYYY-MM-DD'
  15. The code you posted is exactly the code you have? Exactly? Print out $_SESSION var_dump($_SESSION); and see if anything else (besides the member_type) looks wrong.
  16. Right after $handle = fopen($file,"r"); insert fgets($handle); That will read a line from the file and do absolutely nothing with it.
  17. I'm not going to show you how to reverse engineer it because the code is copyrighted. Not hard at all. It defines a few functions for you to use, including one to encrypt and one to decrypt text. [edit] So long as you use the same pencode.php in both places you'll be fine.
  18. explode and in_array are your friends. But really the database should be normalized: keep a separate table for distinct game/mode pairs, one row for each pair. For starters it makes searching much, much easier.
  19. The newlines in the source might be \r\ns. ~<div id="playerskills" align="center">(.+?)</div>~s (/s is the one where dot-all matches newlines, /m is the one where ^ and $ can match the beginning and end of lines) But like I said in your other thread, DOMDocument is much better for this than a regex.
  20. So the comp stuff is the only one you're trying to pre-check now, right? <input type="radio" name="comp" id="comp" value="<?php echo $row["comp"]; ?>" <?php echo ($row['comp'] == "http://www.oplinfo.x11s.org/files/images/comp.gif") ? "CHECKED='CHECKED'" : ''; ?> /> Take a close look at the value of the radio button. Same value you use for the other two even.
  21. I understand what you're saying. I'd still like to see the code: the stuff you have that correctly selects/checks fields, not the one you had a while ago that is close but not quite accurate. [edit] Which I say also because I see differences between what you posted and what's on the site. Like how all the comp images are for comp.gif and how the mode arrays don't use keys.
  22. What are the values of the parameters? What is the $sql?
  23. According to the code you posted it will not select radio buttons or check checkboxes according to existing data. You say you fixed that "technically"? What's your code like after that?
  24. Use something like DOMDocument to get to it. Which would be easier to show if I had more to look at than just a single .
  25. You should have it. I was pointing out a typo.
×
×
  • 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.