Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Pass an Include Through
Old 03-25-2009, 09:52 PM Pass an Include Through
johniman7's Avatar
President, JLI Media

Posts: 965
Name: John Irving
Trades: 0
Ok, this may be hard to explain...

Lets just set up these basic example files...

leftside.php has... "CONTENT HERE"

and I have my php program that creates a file, loads a template file, adds evaluates a few basic variables, and then saves the completed file.

I have <?php include("leftside.php"); ?> in my template file. When the code runs it includes the file and then writes the file.

So I have...

Code:
<html>
<body>
B
</body>
</html>
But I need the actuall PHP include to transfer through to the file so it should be...

Code:
<html>
<body>
<?php include("leftside.php"); ?>
</body>
</html>
Sorry if my explanation was long and confusing, I wasn't really sure how to explain it. Thanks, John
__________________
Cheers, John Irving: My Blog
JLI Media:
Please login or register to view this content. Registration is FREE
| Website Development (Link Coming Soon!)
johniman7 is offline
Reply With Quote
View Public Profile Visit johniman7's homepage!
 
 
Register now for full access!
Old 03-25-2009, 11:16 PM Re: Pass an Include Through
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
I'm not sure that I'm understanding.
Can't you just write the string '<?php include("leftside.php"); ?>' to the file?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 03-26-2009, 12:53 AM Re: Pass an Include Through
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
I would suggest using a function to read the file, instead of including it. Try get_file_contents() for example.

PHP Code:
$leftside file_get_contents('leftside.php');
$new_page "
<html>
   <head><title>My new site</title></head>
   <body>
      Something goes here...
      
$leftside
      Something else here...
   </body>
</html>
"

__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Reply     « Reply to Pass an Include Through
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18393 seconds with 12 queries