Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. copy works too.
  2. That syntax is bad, yes. Accessing them in general is fine, but the way to do it is self::$FormatType Yes, PHP is tolerating the code, but somewhere it's creating warning messages (even if you can't see them).
  3. requinix

    Json

    $offers is an array of offers. $object = array( "pages" => 2, "offers" => $offers ); JSON-encode that.
  4. #194#160 is the UTF-8 encoding of a non-breaking space. So decode it first, remove the whitespace, and re-encode it.
  5. You don't need more code for this. $max = min(array($sym, $res)); There. Do you understand it now? If you don't ever want $naq to be the minimum then don't include it in the list.
  6. I would love to hear the actual problem you're trying to solve. The one that you think this generating-functions-at-runtime stuff is the solution to. Because honestly: this is all silly. There are much better ways.
  7. Use SimpleXML and an XPath query. If there's only the one in the whole document, //int[@name='reqJob']
  8. number_format() doesn't quite do what you're expecting. Try round instead.
  9. Is stripping out the HTML tags an option?
  10. PHP 6 was scrapped. There are no plans for it whatsoever. Anything said about it is meaningless.
  11. One per second? See, this is why I asked and didn't just give you a blind answer. You don't need AJAX for that. Pure JavaScript will be fine. Set an interval for every one second, and when your function fires increase the counter. That's all.
  12. Are you using mysqli_connect()? Are you sure $dbc is an open connection?
  13. You don't have to parse it yourself. SimpleXML will do that. If you don't know how to use it, check the manual for examples.
  14. First word is "AJAX". Second word is generally like "auto-populate" or "auto-generate" or something like that. But basically it's just AJAX. When the one list changes you do an AJAX request to find out what should go in the next list. (And then you put the items in there.)
  15. What are you counting? At (about) what rate does it normally increase?
  16. Look at where you put your parentheses. They aren't all in the right places. And you don't need to mysql_real_escape_string() a number. And you don't need to use quotes in the query if they're around numbers.
  17. Certainly possible. Start with SimpleXML.
  18. allow_url_include is unsafe and should never be used; allow_url_fopen is the "safe" one that should be enabled. Just to put that out there. Using something to automatically update (via FTP or whatever) is the best option, but it can take a while to set up a good system. Short of that, my suggestion is to "copy" the CMS for each client, but for the files that you want shared what you actually copy are a bunch of links* pointing back to the originals. Thus you can keep include()ing the same files. When you need to customize files you remove the links, copy the files, and make your changes. You need to make sure file permissions are set up on the originals so that anybody can read them - that could be the problem you have now. 0644 on regular files, 0755 on directories. * Symbolic. There's a chance that PHP will realize they're symbolic and take special actions (I don't know but I wouldn't expect it); those actions may screw up the whole idea, in which case you'd need hardlinks instead.
  19. What do you get if you print out $query?
  20. With PHP there are many, many ways of doing something. Narrow it down to the methods that actually work and are safe (feel free to ask for help on that part) then pick the one you like best.
  21. dirname() will only work in some of the situations. For example, it won't work with URLs like "/path/to/file.php?query_string". strtok(), or some similar method, will work on every URL.
  22. So update $nwhatever every time it gets adjusted in the database. That way you don't have to keep looking it up.
  23. bin2hex Spoiler: "octet" was the right term.
  24. Maybe a description of the problem you're having?
×
×
  • 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.