Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Write to files using php?
Old 01-03-2006, 08:22 PM Write to files using php?
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
Okay i am creating a custom donation tracker with paypal built in to. now i am working on a installer(for easy of use for others) since my db is clean (and i just got all the sql code from phpMyAdmin) now how would i have php write varibles to various config files?

srry i dont have any code to help you out, as im still working on most of it, i just wanted to work on the installer a lil bit to see what i need to get it to work.


My donation tracker is going to be php & mysql backend.

OKay i dont think that my questions was all clear so lemme rephase it.

The installer for my script needs to edit 2-3 files at least. how would the installer go about and ammend the files. some of the things i need to ammend with the installer would be database connections (so the user does not have to do it manually) and also to edit the paypal config files with the users own info.

So what would i need to do (ie put in both the installer & the org. config files) so the installer automaticlly converts the info in the files to the new users.

i never have tried anything about creating a "automatic" installer were you dont have to enter different php files and doing it the old fashion way.
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1

Last edited by amw_drizz; 01-03-2006 at 09:39 PM..
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
 
Register now for full access!
Old 01-04-2006, 01:45 PM
0beron's Avatar
Defies a Status

Posts: 1,832
Location: Somewhere else entirely
Trades: 0
as long as the config files aren't huge you can load the whole file into an array with $array = file("filename");
Then you can amend the appropriate lines by finding and changing them in the array. Once you are done you can loop over the array writing out lines to the file as you go. This overwrites the whole file, but since you read the original into the array you get the same file back, this time with your changes.
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';

Please login or register to view this content. Registration is FREE
(aka MSN handwriting for forums)
0beron is offline
Reply With Quote
View Public Profile Visit 0beron's homepage!
 
Old 01-07-2006, 07:00 PM
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
can some1 help me get the base of the installer created as i have no idea how to write to the config file and access it from the installer
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Reply     « Reply to Write to files using php?
 

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.41279 seconds with 12 queries