I’m trying to create a php page with fopen() this php file will house the passwords and usernames for my clients database info like host adress and stuff like that, but when I try stuff like this:
$filename = "pass.php";
$ourfile = fopen($filename, '<?php session_start(); ?>') or die(mysql_error());
fclose($ourfile);
It just rejects it and says:
Warning: fopen(pass.php) [function.fopen]: failed to open stream: No
error in C:\wamp\www\forum\installer\checkinstall.php on line 12
I want to have something like:
<?php
session_start();
$dbhost = "localhost";
$dbname = "hey";
$dbuser = "root";
$dbpass = "";
?>
but ever time it just wips out that error.
fopen() opens a file, you need to use fwrite() to actually write to the file. Please look at the examples in the documentation on http://www.php.net
And the filesystem doesn’t give mysql errors.