Jump to content
xisto Community
Sign in to follow this  
iGuest

Include command

Recommended Posts

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

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! :P What do you mean by that :?: :!:

Share this post


Link to post
Share on other sites

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

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.