Included files work around -- help
Posted: Sat Aug 04, 2007 8:21 pm
Hi all ,
Again i have a question i will get to the point quickly i have 3 php files
1.php
2.php
3.php
and dp.php
what happens is 2.php is the main file when i try it it worx so the quiestion is can included files be used to call included functions in the included file ?!!!!!!!!!!!
regards
Again i have a question i will get to the point quickly i have 3 php files
1.php
Code: Select all
<?php
error_reporting(E_ERROR | E_PARSE);
define( 'IBIET', 1 );
include "3.php";
include "db.php";
?>Code: Select all
<?php
error_reporting(E_ERROR | E_PARSE);
include "1.php";
$DB = new db;
echo "databe is ";
echo $DB->obj['sql_database'];
?>Code: Select all
<?php
if ( ! defined( 'IBIET' ) )
{
print "You cannot access this file directly.";
exit();
}
$string = "waleed";
?>Code: Select all
<?php
if ( ! defined( 'IBIET' ) )
{
print "You cannot access this file directly.";
exit();
}
class db {
var $query_count = 0;
var $obj = array (
'sql_host' => '127.0.0.1',
'sql_user' => 'root',
'sql_pass' => '12345678',
'sql_database' => 'latin1'
);
function connect()
{
@mysql_connect($this->obj['sql_host'], $this->obj['sql_user'], $this->obj['sql_pass']);
@mysql_select_db($this->obj['sql_database']) or die(mysql_error());
}
}
?>regards