Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 20-09-06
lakrasia's Avatar
Dot Com Pennyaire
 
Join Date: Jan 2004
Location: this month, Guatemala
Posts: 626
Thanks: 0
Thanked 0 Times in 0 Posts
lakrasia is an unknown quantity at this point
  can't get php fopen to read a file on my PC

Hi,

I expected this to be easy, but I can't get it to work.

PHP Code:
$file="C:/Work/myfile.csv";
$handle fopen("$file","r"); 
It falls over because it refuses to look on my C drive, but instead expects it in the directory of the website (blah/public_html/blah/blah).

I've also tried it with double backslashes and get the same problem.

I read that it might be because I'm using Windows XP and not UNIX - if that's the case, then I'll have to ftp it, but I wondered if anyone else knows for sure, as I'd rather read it directly off my PC.

Thanks very much.
__________________
I used to have an open mind but my brains kept falling out.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 20-09-06
andy_jacko's Avatar
curiouser and curiouser
 
Join Date: Sep 2003
Location: uk
Posts: 654
Thanks: 0
Thanked 0 Times in 0 Posts
andy_jacko is an unknown quantity at this point
try

PHP Code:
$file="file:///C|/Work/myfile.csv";
$handle fopen("$file","r"); 
andy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 20-09-06
lakrasia's Avatar
Dot Com Pennyaire
 
Join Date: Jan 2004
Location: this month, Guatemala
Posts: 626
Thanks: 0
Thanked 0 Times in 0 Posts
lakrasia is an unknown quantity at this point
Thanks SO much. It works and I can't tell you how great it is to wake up after working late on this and find someone else has solved my problem!!!!
__________________
I used to have an open mind but my brains kept falling out.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 20-09-06
lakrasia's Avatar
Dot Com Pennyaire
 
Join Date: Jan 2004
Location: this month, Guatemala
Posts: 626
Thanks: 0
Thanked 0 Times in 0 Posts
lakrasia is an unknown quantity at this point
Drat - I spoke too soon - being bleary in the mornings, I didn't test it properly and I'm still getting the same error.
__________________
I used to have an open mind but my brains kept falling out.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #5 (permalink)  
Old 20-09-06
drivetowin's Avatar
Driving to win
 
Join Date: Aug 2003
Location: If I'm not at home, I'm in hospital
Posts: 7,363
Thanks: 5
Thanked 8 Times in 5 Posts
drivetowin seems to know their stuff
Just to be clear - where is the php file - are you running it locally on your pc or is it on your web server?
__________________
Never argue with idiots. They just drag you down to their level and then beat you with their experience.

If ignorance is bliss then some of the people I know must be orgasmic.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
its always the simple things (php fopen) morleymouse Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 4 19-11-04 12:27 AM
PHP - No input file specified. - Problem Barry Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 1 02-08-04 10:57 AM
PHP write file that is writable scifind Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 3 30-01-04 10:12 AM
Downloading a file using PHP wibble99 Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 10 19-01-04 02:15 PM
PHP File Security for Includes bonedome Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 0 01-01-04 09:11 AM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7