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
Naeem
Forum Commoner
Posts: 31 Joined: Tue Jul 07, 2009 12:48 pm
Post
by Naeem » Thu Aug 13, 2009 3:26 am
I have file like this:
Code: Select all
<?php
$database = "Writing Text here";
I want to that when user submit input it's write into $database = "writing text here"; using fwrite function how to do that?
Thanks.
onion2k
Jedi Mod
Posts: 5263 Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com
Post
by onion2k » Thu Aug 13, 2009 3:50 am
If that's the entire file then it's probably easiest just to rewrite the whole thing. Eg
Code: Select all
fputs($file, "<?php\n\$database = \"".$value."\";");
Naeem
Forum Commoner
Posts: 31 Joined: Tue Jul 07, 2009 12:48 pm
Post
by Naeem » Thu Aug 13, 2009 3:55 am
No it's not a entire file i just want to write the input data here only: