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 7 of 7
  1. #1
    Regular Coder
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    528
    Thanks
    8
    Thanked 8 Times in 8 Posts

    include() other sites

    Isn't possible to include() another site.. eg. include ("http://yahoo.com"); - or do I need a different function?

    Thanks in advance!

    Taylor.

  • #2
    Regular Coder
    Join Date
    Nov 2002
    Location
    Manchester, UK
    Posts
    533
    Thanks
    4
    Thanked 1 Time in 1 Post
    that should work fine!

    PHP Code:
    include ("http://www.codingforums.com"); 

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by homerUK
    that should work fine!

    PHP Code:
    include ("http://www.codingforums.com"); 
    Noooo! Don't do this! Security warning: When you include() a file, the content gets read and evaluated as PHP. This means if you should send PHP code inside <?php ?> from the foreign site, the foreign code gets executed on your site, with your permissions etc.!

    If you want to get the content and that in a safe manner, use readfile() instead.
    De gustibus non est disputandum.

  • #4
    Regular Coder
    Join Date
    Nov 2002
    Location
    Manchester, UK
    Posts
    533
    Thanks
    4
    Thanked 1 Time in 1 Post
    oh gosh! I never thought of that!! I've never needed to include another page like this, so its not been a problem, but thanks for the heads up!

    One way do include a page might be to use an iFrame or ilayer to display it?

  • #5
    Regular Coder
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    528
    Thanks
    8
    Thanked 8 Times in 8 Posts
    Yeah - I finished up using iframe - but wasnt ideally what I wanted. No biggie. BUT.. what is ilayer??? LOL

    Taylor.

  • #6
    Regular Coder
    Join Date
    Nov 2002
    Location
    Manchester, UK
    Posts
    533
    Thanks
    4
    Thanked 1 Time in 1 Post
    i think its the right name? Its the equivalent of an iFrame but for netscape.... I think!!

  • #7
    Senior Coder
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    1,963
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by mordred
    Noooo! Don't do this! [...] This means if you should send PHP code inside <?php ?> from the foreign site, the foreign code gets executed on your site, with your permissions etc.!
    Hahahaa! The idea of the C.F. PHP forum getting included and people's random scripts being run cracked me up straight away

    I take no responsibility for the above nonsense.


    Left Justified


  •  

    Posting Permissions

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