webform must write results on a file , how to do

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
graziano
Forum Newbie
Posts: 9
Joined: Sat Dec 14, 2002 7:16 am

webform must write results on a file , how to do

Post by graziano »

Hello,

I usually send the results of my webforms to an email or to
a database and I have no problem.

Now I have a problem because I have to write on a file the $config variable entered on my web form .

The webform should send/write the results ($config varialble) to config.php file .

Exactly it should write the value inside the $alpha variable on line 25 of that file .

Any idea to do that ? Is it possible to do that (without storing before the variable on a db) ?


Thank you
Graziano
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

You can't exactly know the line but if you know the bytesize of line 25 you could use

Code: Select all

<?php
$fp = fopen("config.php","w+");
fseek($fp,[i]bytesize[/i]);
fwrite("[i]WHATEVER YOU WANT TO WRITE[/i]");
fclose($fp);
?>
Post Reply