Can i use php in this scenario

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
naveednaik
Forum Newbie
Posts: 2
Joined: Thu Oct 23, 2008 8:56 am

Can i use php in this scenario

Post by naveednaik »

Hi
I am relatively new to php so please kndly bear with me. I would appreciate if someone gives me a solution.\
I have two websites with me.
Website 1 & Website 2.
Website 1 has an html file that contains <a href> links.
Now these links i want to display on Website 2.
How can i do this.
Can it be done using php.
<a href="http://indiaprojectsonline.blogspot.com">http://indiaprojectsonline.blogspot.com</a>
Thanks
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Can i use php in this scenario

Post by aceconcepts »

Code: Select all

file()
User avatar
Syntac
Forum Contributor
Posts: 327
Joined: Sun Sep 14, 2008 7:59 pm

Re: Can i use php in this scenario

Post by Syntac »

Or file_get_contents(), if you have PHP 5.
naveednaik
Forum Newbie
Posts: 2
Joined: Thu Oct 23, 2008 8:56 am

Re: Can i use php in this scenario

Post by naveednaik »

I think u didnt understand.
I have http://website1/one.html
and
I have http://website2/links.html
Now i want to display the links.html of website2 in one.html in website1.
How can this be achieved.
Thanks in advance.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Can i use php in this scenario

Post by aceconcepts »

By using the file() function to get the content (file_get_content()) of the site - extracting the links.
Post Reply