Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Maybe. Does it do what you want? If not then what URL are you redirecting to what URL?
  2. $naqahdah = $naqahdah - $cost_homes;
  3. Use strtok on the REQUEST_URI: strtok($_SERVER["REQUEST_URI"], "?")
  4. 1. Does your server have mod_rewrite enabled? 2a. How do you know it doesn't work? Are admin.php and index.php not running at all, or are they not running correctly? 2b. Could it be that admin.php wants the page name without the "a/" path?
  5. To keep the original httpd.conf as "clean" as possible, create another .conf file for settings that you add. Near the end of httpd.conf is a bunch of Include directives: put another one at the end for your new .conf. Inside that new file put the ProxyPass I posted, then reload/restart Apache.
  6. Just use INI files and parse_ini_file. Don't do any PHP-code nonsense when there's a much simpler solution that's actually geared towards this exact use case anyways.
  7. RewriteConds and (a single) RewriteRule go together as a set. If you want a more specific rule than "everything goes through index.php" then add another set of Conds+Rule before the generic rule.
  8. GIMP can't open websites. Your question doesn't make sense.
  9. SELECT 1 FROM pm WHERE id = user ID AND read = "unread" LIMIT 1 If you get any rows back at all then there is at least one unread message.
  10. The arrays wouldn't be empty - there would be no arrays at all. $lat and $long are only defined if the loop runs, and if there aren't any matching $ids in the database then the loop will not run...
  11. 1. That's hashing, not encryption. 2. Actually it would hash "1234password1234". Remove the ",0" in the second call to substr() to fix that.
  12. You can use iconv() or the mbstring extension to convert between text encodings. Get the strings from the RSS feed, as you normally would, but convert them to UTF-8 before you do anything else.
  13. That output you posted looks like it was UTF-8 encoded twice. Okay. The RSS feed is probably in UTF-8 form. As long as your HTML output is also UTF-8, whether that's through a header header("Content-Type: text/html; charset=utf-8"); or a META tag you shouldn't need to do anything else with the text. Problems arise when the input and output aren't in the same encoding, or something tries to change the encoding of the data while it's in transit (such as a utf8_encode() when it's not needed). So theoretically, all you need is to have the RSS's encoding match the HTML page's encoding. Separately, don't use htmlentities() for that STORE_XML_RSS_FILE. It's only needed when outputting to HTML. It's unlikely that the URL would contain anything that would be entity-ized (as it would be an invalid URL to begin with) but still, isn't needed. And a slight correction to something Dan said earlier. ...Kinda. The whole thing was a bit vague. When putting text into RSS use htmlspecialchars, not htmlentities(). The difference is that the latter will try to encode some characters into HTML entities, but XML does not support those same entities. That is, things like "é" in XML are generally invalid. The former will only encode the characters that are strictly necessary: ampersands, less-thans, greater-thans, and double quotes. Plain XML only supports those four and numeric entities (like {). After that's right, if you have problems then you need to deal with character encoding. That's specified in the
  14. Try LEFT...
  15. Drop that extra equals sign and add a "url=": echo ""; Also know that it's entirely up to the browser whether it'll refresh the page or not (but most do).
  16. You didn't put any quotes around the email.
  17. There doesn't seem to be an IndexOption for it, so the answer would be "You can't - just write a simple script yourself for this".
  18. How about using null?
  19. Why do you have to scrape pages from your own website?
  20. How did you come to that conclusion? Experience, and from having seen many of these questions in my time. Look at the code as HTML markup, not PHP code: the <?php is the beginning of a tag which doesn't end until the next />. The following "; } ?> will be rendered as text - precisely as OP described.
  21. Either your file is not named *.php or PHP is not installed/installed properly.
  22. That's a very typical, though not ideal, setup for using multiple subdomains on one machine. Simply using subdirectories makes it easier for (most) people to keep track of their stuff - means they don't have to remember 25 different locations for the 25 different webroots.
  23. array_rand() has a history of not being terribly random, with the problem getting worse as the size of the array or the number of samples increases. I believe they adjusted the logic a while back (like in the 5.2 tree) so recent versions of PHP should be fine. Like I ran your code on a 5.3 and it worked as expected; if I still had a 4.4 and 5.2 around I'd try on those too.
  24. Yeah. Animations like and .
  25. What code did you run?
×
×
  • 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.