Connecting Tech Pros Worldwide Help | Site Map

fwrite

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 12:15 PM
Ken
Guest
 
Posts: n/a
Default fwrite

I have a template.php file in which the results is created with session
variables.

I want to write the actual data, not session variables, into a file called
test.tmp

I can view the actual data when template.php is displayed.

When I write the data to test.tmp, the session variables are copied, not the
results of the variables.

How do I write (save) the results of the template.php in test.tmp?

$url_read = $_SESSION['folder_dir']."template.php";
$url_write = $_SESSION['folder_dir'].'test.tmp';
$f_r = file($url_read);
$read_file = fopen($url_read, "r");
echo $read_file;

$f_w = file($url_write);
$write_file = fopen($url_write, "w");
foreach($f_r as $line) {
fwrite($f_w,$line);
}
fclose($read_file);
fclose($write_file);

Thanks.

Ken




 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.