Having problen in opening csv file for reading ?

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
bhallash
Forum Newbie
Posts: 4
Joined: Thu Nov 27, 2008 1:23 am

Having problen in opening csv file for reading ?

Post by bhallash »

Code: Select all

 
<?php
  echo $OverrideDuplicates = $_GET["OverrideDuplicates"];
  echo $importfile  = $_GET["importfile;
  echo $useserver = $_GET["useserver"];
  echo $serverfile= $_GET["serverfile"];
  echo $Headers = $_GET["Headers"];
  echo $FieldSeparator =$_GET["FieldSeparator"];
  echo $FieldEnclosure = $_GET["FieldEnclosure"];
 
 
   $f_name = array();
 
  
  
   echo "sdfsdfsf";
 
 
if (!$handle = fopen($importfile, 'r')) {
         echo "Cannot open file ($importfile)";
         exit;
    }
else
{
 
    
    echo "Success, wrote ($content) to file ($filename)";
}
 
 
 
 
 
 


Its not opening the file ......

can any one tell me why ?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Having problen in opening csv file for reading ?

Post by requinix »

Look at line four.
bhallash
Forum Newbie
Posts: 4
Joined: Thu Nov 27, 2008 1:23 am

Re: Having problen in opening csv file for reading ?

Post by bhallash »

i have corrected that but still its printing values but not returning handler
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Having problen in opening csv file for reading ?

Post by papa »

What exactly does your handler path look like and where is the file?
bhallash
Forum Newbie
Posts: 4
Joined: Thu Nov 27, 2008 1:23 am

Re: Having problen in opening csv file for reading ?

Post by bhallash »

actually i am trying to select a csv file using "input type= file" from my computer which i want to open for reading and then uploading values to the data base. when i will select filename by browsing it will be in my computer only ...... but its not returing $handler as not opening . ....
Post Reply