Current location: Hot Scripts Forums » Programming Languages » PHP » PHP code on a remote file


PHP code on a remote file

Reply
  #1 (permalink)  
Old 05-24-04, 12:39 AM
tonniar .rm tonniar .rm is offline
New Member
 
Join Date: May 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question PHP code on a remote file

I am fairly new to PHP. I am trying to write a script which calls on another file which also includes PHP code, but thus far I cannot get it to work.

To bring the contents of the other file into the original page my code is:

<?php
$menu = file_get_contents("menudata.php");
print("$menu");
?>

.. and it works. But the PHP script written on menudata.php does not function at all. When I check the source - the PHP code itself is actually listed there. I've tested menudata.php individually and it works, so there is no problem with my syntax, I just don't know how to make it work / turn it "on". Hopefully the solution is simple.

Thanks in advance.

Last edited by tonniar .rm; 05-24-04 at 12:41 AM.
Reply With Quote
  #2 (permalink)  
Old 05-24-04, 01:25 AM
MasQ's Avatar
MasQ MasQ is offline
Newbie Coder
 
Join Date: Feb 2004
Location: Norway/Oslo
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Try using the include command instad...

PHP Code:

<?php include("menudata.php"); ?>

__________________
**Schmmotch**
Reply With Quote
  #3 (permalink)  
Old 05-24-04, 02:32 AM
tonniar .rm tonniar .rm is offline
New Member
 
Join Date: May 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up

That did the trick! Thanks so much!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP code to edit a text file mdhall Script Requests 12 12-23-10 04:03 AM
Use this code outside of PHP tags? D_tunisia PHP 6 04-12-04 12:06 PM
How to sale php code to customer without giving him code pradeep_soft PHP 4 03-12-04 12:10 PM
Generating PHP code for MySQL ptesone General Advertisements 1 02-03-04 08:26 AM
protecting code in PHP ckb PHP 12 01-02-04 08:53 AM


All times are GMT -5. The time now is 10:35 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.