-
Posts
15,229 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
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.
-
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().
-
"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.
-
Rewrite loop. Losing the will to live.
requinix replied to Shutupquare's topic in Apache HTTP Server
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. -
No difference besides the indexing. What's the code that gets it?
-
Arrays are arrays, you can loop through them all the same way.
-
Rewrite loop. Losing the will to live.
requinix replied to Shutupquare's topic in Apache HTTP Server
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. -
Are you talking about actual files? Is "ARCHIVE" a directory or just what shows up in the URL?
-
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", ... );
-
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.
- 1 reply
-
- url redirect
- form
-
(and 2 more)
Tagged with:
-
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.
-
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).
-
Rewrite loop. Losing the will to live.
requinix replied to Shutupquare's topic in Apache HTTP Server
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. -
Not a whole lot. The and are outside the loop. Put them inside the loop.
-
validation on textarea to allow only characters no numbers!
requinix replied to saravanataee's topic in Javascript Help
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.- 3 replies
-
- validation
- textarea
-
(and 1 more)
Tagged with:
-
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.
-
Rewrite loop. Losing the will to live.
requinix replied to Shutupquare's topic in Apache HTTP Server
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? -
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.
-
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
-
Fix it which way?
-
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.
-
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...
-
Rewrite loop. Losing the will to live.
requinix replied to Shutupquare's topic in Apache HTTP Server
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? -
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.
-
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.