RSS Forums RSS
Please support our PHP advertiser: Lunarpages PHP Web Hosting

PHP Includes +

Join Date: Jul 2005
Posts: 12
Reputation: bgharper is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
bgharper bgharper is offline Offline
Newbie Poster

Re: PHP Includes +

  #2  
Jul 25th, 2005
Originally Posted by ashneet
I am new at php so this might me a dumb question.

Is it possible to use part of an include file another words i make an 1 big include file and only use parts of it as needed and not make many include files.

Also is it possible to delete an whole variable so that it dont messes thing up when we get back to same page with diffrent info in th variable.

In the include file, if you do if statements, you can then include parts of it. This is how I typically call parts of an include file. Example of an include.php...

[PHP]<?php if ( $page == "1" ) { ?>
Page 1
<?php elseif ($page == "2" ) { ?>
Page 2[/PHP]

And so forth. Call it like this...

[PHP]<?php include "include.php?page=1"; ?>[/PHP]

Second, to "delete" a variable, you can use the unset function. This essentially destroys the variable.

[PHP]<?php unset($var1, $var2, $var3); ?>[/PHP]

Hope this helps.
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:48 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC