You'd think so, wouldn't you? I got bitten by this one.Quote:
No... for security, pages on other servers are executed as plain text, passed directly to the output buffer. No?
Printable View
You'd think so, wouldn't you? I got bitten by this one.Quote:
No... for security, pages on other servers are executed as plain text, passed directly to the output buffer. No?
The URL in the echo statement is the page you are looking for the table.
It will get the html from that page and search it for the table.
Twey, that's really stupid. Perhaps this is the root of your dislike for the language? :p
You can't include remote files with PHP5. It's disabled by default.Quote:
You'd think so, wouldn't you? I got bitten by this one.
I've even tried it with the GoDaddy servers...
Unless you're hosted with erm... STUPID PEOPLE?
But you should be able to. It simply shouldn't be a security risk. Perhaps they'll fix with PHP6....
Code:Warning: include() [function.include]: URL file-access is disabled in the server configuration in G:\apache\htdocs\home\peter\public_html\remoteinclusion.php on line 1
Warning: include(http://thebrbforums.com/) [function.include]: failed to open stream: no suitable wrapper could be found in G:\apache\htdocs\home\peter\public_html\remoteinclusion.php on line 1
Warning: include() [function.include]: Failed opening 'http://thebrbforums.com/' for inclusion (include_path='.;C:\php5\pear') in G:\apache\htdocs\home\peter\public_html\remoteinclusion.php on line 1
veiled I have to test script php but when I open the page with my exploring it posts me only that
'.$b.'')); $fn = strpos($f,'',strpos($f,''.$b.'')))-strpos($f,''.$b.'')); return substr($f,strpos($f,'
In order to use PHP code on the page, you must place it within <?php ..... ?> tags, have PHP installed/enabled on your server, and the page must end with the .php extension, not .htm.
I'm guessing that the last thing is the problem. Rename your page [yourname].php
No, not really. It certainly doesn't curry it any favour, but the root of my dislike for the language is its inane inflexibility -- like passing "functions" by passing their name as a string, and defining all functions superglobally to make this possible.Quote:
Perhaps this is the root of your dislike for the language?
That means you have url_fopen disabled entirely, not just for includes. This will prevent you doing fopen() or get_file_contents() on remote resources as well. It's about 50:50 whether a given server will have this enabled or not, in my experience.Quote:
Warning: include() [function.include]: URL file-access is disabled in the server configuration in G:\apache\htdocs\home\peter\public_html\remoteinclusion.php on line 1
The PHP isn't being parsed.Quote:
veiled I have to test script php but when I open the page with my exploring it posts me only that
'.$b.'')); $fn = strpos($f,'',strpos($f,''.$b.'')))-strpos($f,''.$b.'')); return substr($f,strpos($f,'
my waiter accepts the php well. The name of the file is correct (test.php).
do you have an idea on the failure of this script at home?
I have to test on several waiters and it always posts an error
http://membres.lycos.fr/powersat2/
http://powersat.alwaysdata.net
even with the various waiters, script does not post what it would owe
Here's the code, fixed a bit:
PHP Code:<?php
function get_table($page,$b) {
$f = file_get_contents($page);
$st = strpos($f,'<table',strpos($f,'<b>'.$b.'</b>'));
$fn = strpos($f,'</table>',$st)-$st;
return substr($f,$st,$fn);
}
echo get_table('http://the.com/page.htm','D+');
?>