This is what i want to do.
I am sharing the same list of links between two domains.
Lets call them Domain1.com and Domain2.com
Is there a way to pull a php file from domain1.com/links.php into domain2.com/links.php
Thanks
This is what i want to do.
I am sharing the same list of links between two domains.
Lets call them Domain1.com and Domain2.com
Is there a way to pull a php file from domain1.com/links.php into domain2.com/links.php
Thanks
Hi,
I don't think you can do this exactly how you describe because by typing in the name of a .php file into a browser, the server will execute the file rather than expose its source code. How is the list generated? ie could you save them in a separate file (like a .txt file on the server which the other domain can also access) and have the two php files parse the file and render the links on the page. Does that help, or have I misinterpreted what you want to achieve?
Cheers,
Jonathan
Server: Pass32 and dedicated server
You have the right idea. I just want both sites to feed from one single file located on ONE of the two domains.
I want it so I can update that one file and it updates the list on both domains.
I guess a .txt file would work but not sure exactly how to pull data from a .txt file
You could do a text file on one and use cURL to read it from the other site.
Or use a database. Which would be easier in my opinion.
Any tips on how to set that up?
It depends on the type of info you're wanting to use. as fury mentioned, it would probably be easiest to use a database.
Set up the database (with user and pass) on one domain. configure the page on that domain to connect to that database locally.
Next configure the page on the other domain to connect to the first domain's database remotely. You will also have to add the server IP of the second domain into the remote mysql access list in cPanel on the first domain.
Russell P. - Server Analyst II
Mountain Dew Knight
Sounds like a pain in the ass to do something that should be simple.
You could also do it with text files and cURL. The reason you can't do it with PHP files is they are interpreted by the server before being displayed. Now if you want to just use the info and not interact with the page, it can work.
It all depends on the type of data you're looking to share across domains.
Russell P. - Server Analyst II
Mountain Dew Knight
If the domains are both on the same server (as in, here on Surpass), you don't need to add the remote IP.
The database option is rather simple, but it does require some knowledge of PHP/mySQL and phpMyAdmin.
To go the text file route, a Google search should result in plenty of information on how to accomplish this with cURL.
There are currently 1 users browsing this thread. (0 members and 1 guests)