Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9

Thread: Php get link

  1. #1
    New Coder
    Join Date
    Nov 2008
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Php get link

    How can I use php to go to this link http://67.212.88.58/~qss/quicksilver...hp?id=GTKL3PZX and copy and paste the link it gives you. Isn't it something like this

    <?php $file = readfile("http://67.212.88.58/~qss/quicksilverscreen.com/m1.php?id=GTKL3PZX") ?>

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,978
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Readfile returns an int result representing the number of bytes read.
    In order to retrieve whats there, you'll need to use one of the content retrieval methods of output buffering, such as ob_get_contents().

    You need to have allow_url_fopen to be enabled to get this to work though, and the result of the file must output the actual string you're looking for (you can't read it, it will be processed by the server as php).
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #3
    New Coder
    Join Date
    Nov 2008
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am not really good with php (beginner) can someone show me exactly how to work it.

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,978
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Something like this should work:
    PHP Code:
    ob_start();
    readfile('/path/to/file');
    $result ob_get_clean(); 
    $result should contain the results of readfile.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #5
    New Coder
    Join Date
    Nov 2008
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So like this?
    PHP Code:
    <?php
    ob_start
    ();
    readfile('http://67.212.88.58/~qss/quicksilver...hp?id=GTKL3PZX');
    $result ob_get_clean();
    ?>

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,978
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Yep, if it doesn't work check you're error logs. I would not be surprised if you're host has url_allow_fopen disabled.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #7
    New Coder
    Join Date
    Nov 2008
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    not working i just want the php code to go to http://67.212.88.58/~qss/quicksilver...hp?id=FBTVOPHB and then paste the link that it generates.

  • #8
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,978
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Quote Originally Posted by Fou-Lu View Post
    Yep, if it doesn't work check you're error logs. I would not be surprised if you're host has url_allow_fopen disabled.
    What does you're error log say?
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #9
    Regular Coder PHP6's Avatar
    Join Date
    Aug 2008
    Location
    Czech Republic
    Posts
    237
    Thanks
    18
    Thanked 34 Times in 33 Posts
    Quote Originally Posted by Fou-Lu View Post
    What does you're error log say?
    Good question... I will just add that there is lots of different way (file, file_get_content, curl, socket and so on) how to open this URL but everything depends if you are allowed to make external connection on your server.


  •  

    Posting Permissions

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