Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. FYI SimpleXML is much simpler to use. $xml = new SimpleXMLElement("rss source here since you can't use URLs", 0, false); // if you use a URL change false->true $channel = $xml->channel; echo "<p><a href='{$channel->link}'>{$channel->title}</a><br />{$channel->description}</p>\n"; foreach ($channel->item as $item) { echo "<p><a href='{$item->link}'>{$item->title}</a><br />{$item->description}</p>\n"; } And please try to avoid W3Schools. They have some good information and some bad information and if you're learning PHP it can be difficult to tell which is which.
  2. Seems you have allow_url_fopen turned off. Contact your host and see if they can get that restriction removed for you. Or try cURL and DOMDocument::loadXML().
  3. "todays ago"? Today, or two days ago? For today mktime is easiest. Pass it hour=0 minute=0 second=0. For two days ago strtotime is easiest. Give it a string like "-2 days". Both will return to you a Unix timestamp you can use for comparison in the SELECT query.
  4. I meant the proxy forging the IP address would break it. [edit] Because then the web server would try to send traffic to that fake IP address (the client), except the client would receive HTTP data instead of the HTTPS it was expecting (assuming the proxy also set the source port to the client's). Don't know what would happen but there would certainly be some problems somewhere.
  5. No difference besides the indexing. What's the code that gets it?
  6. Arrays are arrays, you can loop through them all the same way.
  7. No, that's not something that a proxy could safely change. It would break HTTPS, for one. There's something else going on. Contact your web host and see what they're doing.
  8. Are you talking about actual files? Is "ARCHIVE" a directory or just what shows up in the URL?
  9. Associate the suits with their colors. You could $suits = array ( array ( "Spades", "black" ), array ( "Hearts", "red" ), ... ); or $suits = array ( "black" => array ( "Spades", "Clubs "), ... ); or $suits = array ( "Spades" => "black", "Hearts" => "red", ... );
  10. A pure HTML form can't do that. You can use Javascript to emulate a form (not actually submitting a form but clicking the button to trigger Javascript which redirects) or have the form post to a PHP script with a regular, unfriendly URL and then have that script redirect to the friendly version.
  11. Have you checked the return values from mail()? If they're returning true then, as far as PHP is concerned, the emails have been sent - check your spam folder.
  12. Do an fopen/fread/fclose loop that watches the time. $input = fopen(stream) $output = fopen(output file) $end = time() + however many seconds you want to record do { fwrite(fread($input, some amount you determine)) } while time() <= $end fclose($output) fclose($input) Do a bit of trial and error with the amount read in: too high and you'll get more than X minutes of video, too low and you'll waste CPU and potentially get less than X minutes (though probably not by much).
  13. That would certainly explain it. Look at $_SERVER["REMOTE_ADDR"]: if it's a LAN address like 10.* or 192.* then it's probably behind a proxy. (If not, it still could be.) Also $_SERVER["SERVER_PORT"] will be 80 for HTTP and 443 for HTTPS.
  14. Not a whole lot. The and are outside the loop. Put them inside the loop.
  15. I told you where to look, hoping that you didn't need a link to click on. Have you been able to find anything? The point is to get you to learn a bit so you don't have to rely on others.
  16. Look into Tidy. It does a great job at cleaning up mucky HTML. There's a standalone (command-line) application, or apparently a PHP extension.
  17. Modify the Rule to RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI}---%{HTTPS} [R=302,L] Where does it try to redirect you? Specifically, what does that URL imply about the value of HTTPS?
  18. Use mktime() and date() to get the beginning and end of the month. Tip: for mktime(), use day=0 of the next month to get the last day of the current month. Or use MySQL's DATE() function.
  19. Are you using a database for this? MySQL? Know about auto_increment? [edit] Eh, I'll elaborate. If you create a primary key on a table consisting of a field for the date and secondary field that's an auto_increment then MySQL will handle the uniqueness for you. INSERT INTO table (date, ...) VALUES ("20130220", ...) date | increment | ... ---------+-----------+---- 20130220 | 1 | ... INSERT INTO table (date, ...) VALUES ("20130220", ...) date | increment | ... ---------+-----------+---- 20130220 | 1 | ... 20130220 | 2 | ... The ID is then "PO" + date + increment formatted to however many digits you want. Such as echo sprintf("PO%s%03d", "20130220", "1"); // PO20130220001
  20. Fix it which way?
  21. ftps is FTP over SSL. As per normal SSL the first part of the handshake is in the clear and the rest is not. The entire communication from there on is encrypted.
  22. Easiest way would be in the .htaccess. I don't think a Redirect is dumb enough to allow it, so RewriteEngine on RewriteRule ^ http://www.mywebsite.com/?url=%{HTTP_HOST}%{REQUEST_URI} [R=301,L] That's assuming you're talking about redirecting everything, which seems kinda weird...
  23. I'm probably just missing it but I don't see a loop [edit] unless you don't have SSL set up [/edit]. Where does the browser get redirected to?
  24. Your form contains many textboxes and textareas, all named "id" and "article_content". They will all overwrite each other and you'll only get the value from the last one in the form. You can a] Write a form for every article (move the inside the loop) which only lets you update one article at a time, orb] Make a smarter, more complicated form that lets you update more than one at a time.
  25. No, you've ORed all of them together which means that at least one of the five has to match. There are no restrictions on which. Don't use conditions that you don't want to check. If $option doesn't have a value then don't include it at all.
×
×
  • 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.