Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: migrating
Maybe I should clarify the difference between my old server up and the new one. In the old server the forum was residing inside the main domain. After Joyend’s advice, now the forum is working like an independent domain. The includes I was using in the previous setup were cross-domain (fetching content from our sites) except the forum as I mentioned earlier and everything was working wonderfully.
<?php echo file_get_contents('http://mysite.tld/?rah_external_output=bar'); ?> works fine for the txp sites but for the forum, it is not parsed.
Can anyone point me to the right direction on how I can display this txp content?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: migrating
Try using Curl
I had a similar problem a few years ago with get_file_contents and include, both of which had been turned off or something on the server and the admins told me to use Curl…. I did, and it worked.
Not sure on the technicalities though
Offline
Re: migrating
Thanks tye
<?php
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, 'http://mysite.tld/?rah_external_output=bar');
curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1);
echo curl_exec ($curl);
curl_close ($curl);
?>
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://mysite.tld/?rah_external_output=bar');
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$file = curl_exec($ch);
$http = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $file !== false && $http == '200' ? $file : 'Error appeared. Sad face.';
?>
neither of which returned any results.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: migrating
[SOLVED]… I had an include in my rah page which I forgot to change.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: migrating
:) Phew… thought I was going to have to pretend I knew what I was doing then
Offline
Re: migrating
tye wrote:
:) Phew… thought I was going to have to pretend I knew what I was doing then
lol. No worries, your suggestion pushed me to think more laterally anyway and assisted in solving the issue.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline