Current location: Hot Scripts Forums » Programming Languages » PHP » How do you read and write to files


How do you read and write to files

Reply
  #1 (permalink)  
Old 05-14-08, 11:50 PM
dacksal dacksal is offline
Newbie Coder
 
Join Date: Apr 2008
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
How do you read and write to files

I want to be able to read text files contain more than one lines of links like www.cool.com Thats all the text files i have. and then i want to write out html files of the same file name with links of the those links but with <a href="cool">Text to be displayed</a> instead

I also want one extra thing where u can text box with browse button and another button to execute the whole thing

can anyone help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 05-15-08, 03:27 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
Have a look at the Filesystem Handling functions, especially file_get_contents, file_put_contents, file, fopen, fread and fclose

To output the data as a list of links, you need to loop over the data in the files and output the content as links.

What exactly do you mean with:
Quote:
Originally Posted by dacksal View Post
I also want one extra thing where u can text box with browse button and another button to execute the whole thing
I don't quite follow
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 05-15-08, 05:15 PM
dacksal dacksal is offline
Newbie Coder
 
Join Date: Apr 2008
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
well the text files need to come from somewhere right, so i want a textbox where you can browse for the file on your computer and then load the address of the text file to be submitted
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 05-15-08, 09:03 PM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Quote:
Originally Posted by dacksal View Post
well the text files need to come from somewhere right, so i want a textbox where you can browse for the file on your computer and then load the address of the text file to be submitted
I think you're referring to an HTML file upload control, not a textbox.
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 05-15-08, 09:18 PM
dacksal dacksal is offline
Newbie Coder
 
Join Date: Apr 2008
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
yeah thats exactly it, so how do i assign the uploaded file name as a variable so i can manipulate it
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 05-15-08, 11:12 PM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Quote:
Originally Posted by dacksal View Post
yeah thats exactly it, so how do i assign the uploaded file name as a variable so i can manipulate it
Well, you could start by reading this page. Or this one. Or even this one.
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
simple text read and write script Kevin Raleigh Script Requests 1 08-19-06 05:16 PM
Files & Database ??? aniraka PHP 4 07-13-05 01:52 PM
Can javascript be used to read and write to a text file kept on a webserver? gmb1994 JavaScript 4 11-23-04 11:50 AM
Database file or object file is read only, w_inaim ASP 2 09-21-04 03:18 PM
PHP - Dir listing and write to file NickyWhicko PHP 4 08-24-03 03:42 AM


All times are GMT -5. The time now is 03:25 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.