-
Posts
15,227 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
Maybe. Does it do what you want? If not then what URL are you redirecting to what URL?
-
$naqahdah = $naqahdah - $cost_homes;
-
Use strtok on the REQUEST_URI: strtok($_SERVER["REQUEST_URI"], "?")
-
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?
-
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.
-
Looking for best solution to get variables from a file
requinix replied to asmith's topic in Application Design
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. -
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.
-
download a page and open it later with gimp doable
requinix replied to dilbertone's topic in PHP Coding Help
GIMP can't open websites. Your question doesn't make sense. -
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.
-
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...
-
1. That's hashing, not encryption. 2. Actually it would hash "1234password1234". Remove the ",0" in the second call to substr() to fix that.
-
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.
-
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
-
Try LEFT...
-
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).
-
You didn't put any quotes around the email.
-
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".
-
How about using null?
-
Sorry first post here, help request for preg_match page scrape
requinix replied to fapapfap's topic in PHP Coding Help
Why do you have to scrape pages from your own website? -
Reading a text file and displaying its contents
requinix replied to Mike D's topic in PHP Coding Help
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. -
Reading a text file and displaying its contents
requinix replied to Mike D's topic in PHP Coding Help
Either your file is not named *.php or PHP is not installed/installed properly. -
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.
-
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.
-
Yeah. Animations like and .
-
What code did you run?