Valleriani Posted May 21, 2007 Share Posted May 21, 2007 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? Quote Link to comment Share on other sites More sharing options...
spode Posted May 21, 2007 Share Posted May 21, 2007 I'm not quite sure what you are asking. But the only thing I can think of is putting the file on the same server and using include() or require(). I'm a noobie but hope it helps? Quote Link to comment Share on other sites More sharing options...
trq Posted May 21, 2007 Share Posted May 21, 2007 But the only thing I can think of is putting the file on the same server and using include() or require(). The files don't need to be on the same server if you have allow_url_wrappers enabled. Take a look at include. Quote Link to comment Share on other sites More sharing options...
Valleriani Posted May 22, 2007 Author Share Posted May 22, 2007 Aye right now I'm getting errors like, 'Fatal error: Call to a member function on a non-object in /home/super/public_html/RSSAssassin.php on line 71' Not sure why exactly. Is it more for just calling only variables? Quote Link to comment Share on other sites More sharing options...
Valleriani Posted May 22, 2007 Author Share Posted May 22, 2007 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.