iGuest 3 Report post Posted January 18, 2005 1)How to write the "Include" command and how to use it??2)How to insert text in to php file and do that the text wont be viewd? (i want to insert rhits, instrucions and more)Thanks, sorry for the spelling mistakes. Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 18, 2005 to use the include command you can use:<?php include "file.ext";?>that will include any file that you define between the tow double quoted quotemarks.But I don't understand you secound question on to include a text file but don't show it! What do you mean by that :?: :!: Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 18, 2005 Thanks. Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 18, 2005 by your second question do you mean something like this? <?///////this line wont be parsed as php/*theselines wont be parsed as php*/?> or like this- so that you can call it later as a variable?<?$form = <<<HTML<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><form name="form" method="post" action="?page="> <table width="100%" border="0" cellpadding="4" cellspacing="0"> <tr> <td> Insert form fields and the like </td> </tr> <tr> <td align="left" valign="top"> </td> <td><input type="submit" name="Submit" value="Save Changes!"></td> </tr> </table></form>HTML;?>then<?print $form;?> Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 23, 2005 About the Include..if you want to include the file in more than just one page. Just use <?php Include_Once("YourFile"); ?>or<?php Require_Once("YourFile"); ?>Both are worktig well Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 23, 2005 Sulfer, what do you mean in more than just one page? i use include file.ext for all my includes in my main page... for instance, i'll include my db connection... then files i include in my main page further down dont neeed the db connection inserted. How does that differ for include_once ? thanks Share this post Link to post Share on other sites