Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 37

Thread: copy a table

  1. #21
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    No... for security, pages on other servers are executed as plain text, passed directly to the output buffer. No?
    You'd think so, wouldn't you? I got bitten by this one.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  2. #22
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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?
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #23
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    You'd think so, wouldn't you? I got bitten by this one.
    You can't include remote files with PHP5. It's disabled by default.

    I've even tried it with the GoDaddy servers...
    Unless you're hosted with erm... STUPID PEOPLE?
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  4. #24
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    But you should be able to. It simply shouldn't be a security risk. Perhaps they'll fix with PHP6....
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #25
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    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
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  6. #26
    Join Date
    Aug 2007
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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,'

  7. #27
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  8. #28
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Perhaps this is the root of your dislike for the language?
    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.
    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
    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.
    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,'
    The PHP isn't being parsed.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #29
    Join Date
    Aug 2007
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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
    Last edited by byronghislain; 08-18-2007 at 09:24 PM.

  10. #30
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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+');

    ?>
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •