Hello all. I have a web site that I used to maintain myself and then the company I worked for paid someone to redesign it. They did so partially using php, which unfortunately I don't write in. I'm great with HTML and Perl, but no php. Alas, the new web team's office was destroyed in Hurricane Ivan and I have no contact with them as they all left the area.
Anyway, they use some code to embed another page within a main index.php page. Here is a url as an example:
http://www.mysite.com/index.php?page=http://www.mysite.com/newpage.html
This inserts newpage.html inside a predetermined place in index.php
The problem is they didn't write any code into the index.php that prevents someone from including their own file on a server other than mine. I know how to write this in Perl. I just don't know how in php. Here's the code currently being used to accomplish this in index.php:
<? include($page) ?>
If someone could possibly be so kind as to provide some code that would verify the page in the URL is coming from mysite.com, or from a particular IP address.
Much appreciation and thanks in advance!
Regards,
Steve