Hello
am newbie to php and i want to use some variables (like $hostname,$dbname ...etc) which i defind in the file.php and use it in the index.php ????
How to get variables from file.php???
[man]include[/man]
devinemke wrote:[man]include[/man]
i tried include() but it didn't work the first few line of the code with the error is
<?php
// If they tried to install...
if ($submit )){
$error="no";
$result =@include('settings.php');
// Check if they uploaded settings.php
if ( $result ) { $log.= "Settings.php found <br /> \n";} else { $error="yes"; $log.= "Settings.php not found <br /> \n";}
the error appear in line 8 , i tried to remove the @ but the same... in fact its a php script i tried to install but it appear with this errors so am tring to fix it
When you include a file like:
include("somefile.php");
...later on in your script you can use all the variables from that file...
So if you have defined $some_variable in somefile.php then you can echo it after you included the somefile.php....
include("somefile.php");
echo $some_variable;
yes i remove the $result=@ and its ok now
thanks