just wondering if this is possible…i have a form
i have a databse.inc file which has all the info of what is to be added into the database…thsi all works fine but i wanted to pull some things out to create a config.php file
Many newbies don’t understand this question have no relation to SQL
But merely to the very basic strings operations in PHP.
And can be shortened to
//i had this piece of code
echo "Hello World";
// i created a variable
$name = "World";
//and added edited the code to
echo "Hello $name";
//will this work?
hmm im trying to test it but it doesnt seem to be picking up the variables in my config.php file
this is a .inc file and my config is a .php file
i have included the config.php into the databse.inc
i have this function in my database.inc
/**
Prints error.
*/
function print_not_allowed() {
if ($DEBUG > 1) {
print ‘<br />printing not allowed page<br />’;
}
$content = “You can only register from within a registered $name”;
print_template($content);
}
$name is a defined variable in my config.php file but this is being printed as “$name” in my html instead of the string assigned to the variable
/**
* Print error.
*/
function print_not_allowed() {
global $name;
include 'config.php';
if ($DEBUG > 1) {
print '<br />printing not allowed page<br />';
}
$content = "You can only register from within a registered $name";
print_template($content);
}