Jump to content
xisto Community
Sign in to follow this  
Mike

I Will Provide You With A Php Code That.. ..enable you to use the echo command.

Recommended Posts

**YOU DO NOT NEED ANY HTML TAGS FOR THIS SCRIPT****

Enter all values between the ' ' quotes

 

<?php

 

//Define The Variables

$cfg = array('sitename' => '', //Your Sites Name

'footer' => '', //OPTIONAL, if you want your footer stored so that the echo command can display it. Ex: Copright &copy2005 - Michael Fratello (the © is will turn into the copyright 'c')

'board_dir' => '', //Link to your message boards. (If you have any)

 

);

 

?>

 

I recommend saving this file as cfg.inc.php

 

I believe you have to make a separate configuration thing if you are using the stored variables in a DIFFERENT FOLDER that the one that this 'cfg.inc.php' is stored in.

 

-Using The Variables You Saved-

Notice that your site's name will be stored as 'sitetitle', the footer will be stored as 'footer', and the board_directory will be stored as 'board_dir'. You do not need to post the board directory anywhere.

 

At the top of each page, if you would like to use the stored variables, you MUST put this PHP Code at the VERY TOP.

 

<?php

 

require '' //What you saved the file as Ex: cfg.inc.php

 

?>

 

If you want your site's name to show up on the page, you would post this PHP Code (you can post this ANYWHERE in the file as long as you posted the 'require' code):

 

<?php echo $cfg['sitetitle']; ?>

 

If you want the footer to show up, you would post this:

 

<?php echo $cfg['sitetitle']; ?>

 

 

And that concludes my little PHP Tutorial thing for today. =-P

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.