Jump to content

[SOLVED] Calling PHP within PHP


Valleriani

Recommended Posts

I have a script that is on serveral sites. It changes constantly, so updating 10 sites is a hassle. What I wanted to know if there is a way to call PHP within PHP, using php itself, or javascript, etc. Simply because I'll place the file that is going to be called on a seperate location where all sites can call from it.

 

Can it be called in a .js file? Using <?php at start ?> at end? or is there a easier way?

Link to comment
Share on other sites

For example:

 

mainfile.php has a function which does it's generic stuff to $content

 

so for example:

MAINFILE.PHP

$content = 'Hello';
$content = $content . ' There!';
include 'http://location.com/Test.php';
echo $content;

 

Test.php

$content = $content . 'TESTING!';

 

Basicly its simply I want it to 'add' the line on reading it. But it doesn't seem to be working. I got the error fixed, but its still not adding 'TESTING' to the end of the line.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.