Hello,
Hello and thank you for making the time to read this post. He he.
Ok here is the problem. I have 2 files; test.php and test2.php
test.php reads the file test2.php and shoul dreplace the string "//insert id here" with "$id=9 or any #" by using the fwrite command. BUT This command does not work. I was wondering if there is a way to pass variables to different files rather than transferring them through http.
Here is the code that i have so far:
<?
$fp=fopen("test2.php","w+");
$name="test2.php";
$size=filesize($name);
$read=fread($fp,$size);
ereg_replace("//insert id here","$id=9",$fp);
echo $read;
?>
this opens test2.php and should replace the string with the other string. But this doesnt work for some odd reason. and also one more question. Is it madatory to have $size in order to read the file or can i leave it blank.
Thank you for your time.