DBookatay Posted April 14, 2008 Share Posted April 14, 2008 How do you do an include where it is already in php? Meaning: if ($_GET['tab'] == "TestDrive"){ $show = ' <table class="ftrHldr"> <tr> <td valign="top"><div class="specHdr">Affordability Calculator</div><? include ('include/page_files/affordability_calculator.php'); ?></td> </tr> </table>'; } Quote Link to comment Share on other sites More sharing options...
mrdamien Posted April 14, 2008 Share Posted April 14, 2008 If you don't need anything to be executed, your better off using $calculator = file_get_contents('include/page_files/affordability_calculator.php'); $show = ' <table class="ftrHldr"> <tr> <td valign="top"><div class="specHdr">Affordability Calculator</div>' . $calculator . '</td> </tr> </table>'; If you do need something to be executed, put the code into functions. Then you can do this: <? include('include/page_files/affordability_calculator.php'); if ($_GET['tab'] == "TestDrive"){ $show = ' <table class="ftrHldr"> <tr> <td valign="top"><div class="specHdr">Affordability Calculator</div>' . calculator_function() . '</td> </tr> </table>'; } ?> Quote Link to comment Share on other sites More sharing options...
DBookatay Posted April 14, 2008 Author Share Posted April 14, 2008 Thanks mrdamien, that was what I was looking for... 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.