PHP load from specific file from 1. site and put into 2.site

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
mladja04
Forum Newbie
Posts: 2
Joined: Sat Jun 20, 2015 10:16 am

PHP load from specific file from 1. site and put into 2.site

Post by mladja04 »

Hello. I have some problem and I hope that I write this question into right category.

I have 2 different sites and in first I have one file 1.php in which is 1 row code: {"link_1":"something1","link_2":"something2","link_3":"something3"}

In this file something1, something2 and something3 are changed very often by some script.

Do I can on some way in my second site with php command to take only often changed something1, something2 and something3 from first site and implement into php script in my second site (and that to be visible for users into my second site)?

Can you help me and tell me how to do this (command or script to write me)?

Thank you very much,
Maki
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: PHP load from specific file from 1. site and put into 2.

Post by Christopher »

Use cURL (or compatible class) to fetch 1.php, convert JSON to PHP data, and display to data.
(#10850)
mladja04
Forum Newbie
Posts: 2
Joined: Sat Jun 20, 2015 10:16 am

Re: PHP load from specific file from 1. site and put into 2.

Post by mladja04 »

Thank you very much.

I hope that I will find on net how to use this commands.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: PHP load from specific file from 1. site and put into 2.

Post by Christopher »

(#10850)
Post Reply