Tuesday, April 17, 2012

PHP FILE INCLUDE……


We use to include the file in our page by using INCLUDE function.
Include function is use by 4 method ……..
1 include(‘/filepath/filename’);
2 require(‘/filepath/filename’);
3 include_once(‘/filepath/filename’);
4 require_once(‘/filepath/filename’);

include and require include file when this function is called.
include_once and require_once include only once in a file.
include() produces a Warning while require() results in a Fatal Error. In other words, use require() if you want a missing file to halt processing of the page. include() does not behave this way, the script will continue regardless.
include('connect/connection.php');

Connection file for Database….
< ?php mysql_connect("localhost","root","pass") ; mysql_select_db("myproject") ; ?>
mysql_connect is a php function that is use to connect to the server….
Here LOCALHOST is the server.
ROOT is user name for this server.
Pass is tha password for this server for the ROOT user.

HOME PAGE

0 comments:

Post a Comment