chelnov63 Posted May 14, 2007 Share Posted May 14, 2007 I have a php script called one.php and a php script called two.php Is it possible for one.php to call two.php and retrieve an xml result back from two.php? example pseudocde one.php <?php // call two.php and get the xml result back and echo it out here? ?> two.php <?php echo "<greeting> hello </greeting>"; ?> I'm on a deadline...thanks in adavnce for any help... Link to comment https://forums.phpfreaks.com/topic/51285-php-script-calling-another-php-script/ Share on other sites More sharing options...
jitesh Posted May 14, 2007 Share Posted May 14, 2007 // one.php <?php ........ ....... ...... include('two.php'); ....... ....... ....... ....... ?> Link to comment https://forums.phpfreaks.com/topic/51285-php-script-calling-another-php-script/#findComment-252600 Share on other sites More sharing options...
chelnov63 Posted May 14, 2007 Author Share Posted May 14, 2007 Hi Thanks for that... I should have mentioned two.php script will be on another server. Will this still work? I seem to get errors.. Link to comment https://forums.phpfreaks.com/topic/51285-php-script-calling-another-php-script/#findComment-252605 Share on other sites More sharing options...
jitesh Posted May 14, 2007 Share Posted May 14, 2007 Try Try this // one.php <?php ........ ....... ...... include('http://www.anysite.com/two.php'); ....... ....... ....... ....... ?> Link to comment https://forums.phpfreaks.com/topic/51285-php-script-calling-another-php-script/#findComment-252610 Share on other sites More sharing options...
chelnov63 Posted May 14, 2007 Author Share Posted May 14, 2007 i tried that but was getting errors .however file_get_contents() seems to have done the trick... thanks for your help Link to comment https://forums.phpfreaks.com/topic/51285-php-script-calling-another-php-script/#findComment-252613 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.