troubleshooting Question

Why i failed to called my config file

Avatar of firekiller15
firekiller15 asked on
PHP
3 Comments1 Solution220 ViewsLast Modified:
PHP
Why i failed to called my config file
below is my code

config.php
######LOG#########
$fileHandle = fopen("c:\ERI.log", "a");

Logic.php
#######LOG FILE#############
function LogFile($string)
{
require_once("config.php");
  $str = $string;
  if (fwrite($fileHandle, $str))
    echo "<br>Wrote to file \n </br>";
  else
    echo "write failed. \n";
fclose($fileHandle);
}
#######log testing to file#########
function Testing2()
{
$timestamp = time();
$string = date("l[H:i:s]", $timestamp)."stop process \r\n ";
return $string;
 }

$newERI->LogFile($newERI->Testing1());

if i write $fileHandle = fopen("c:\ERI.log", "a"); i received this error
Warning: fwrite(): supplied argument is not a valid stream resource in C:\wamp\www\testing.php on line 385
write failed.
Warning: fclose(): supplied argument is not a valid stream resource in C:\wamp\www\testing.php on line 389
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros