Re: [PHP] fopen - warnings

2001-07-27 Thread Nessi

That works!
Thanks a lot :)

Cheers, Nessi


At 17:11 26/07/01 , you wrote:
try @fopen(categories.txt,r+);


- Original Message -
From: Vanessa [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 26, 2001 12:05 PM
Subject: [PHP] fopen - warnings


Hello List,

this is probably a very stupid question, but I dont know how to solve this
little problem:
I have a script with which text files (exported access db data sheets) can
be uploaded to the mysql tables.
It all works fine, but very annoyingly I get warning messages, if the text
file is not resident on the server. But I want it in a way that it doesnt
have
to be on the server...a catch. The php manual says that if the file
cannot be opened fopen returns false. All nice and good working, but I get
those additional warning messages. Im not sure if it has maybe something
to do with the server, but I am not convinced. Ill put the code below.
Any suggestions are highly appreciated (I tried die command but it somehow
messed up the routine).

[schnipp]

$file = array (colours.txt, categories.txt, stockmain.txt,
stockcolours.txt);
$i = 0;
while ($file[$i])
{
//öffne das textfile
  $datei = ;

  if ($datei = fopen($file[$i], r+))
  {
  $zaehler = 0;
//check wieviele zeilen das textfile hat
//um zu verhindern, dass es leer ist!
  while (!feof ($datei)) //liest jede zeile einzeln mit
fget()
  {
  $buffer = fgets($datei, 1000);
  //echo $buffer;
  //echo br;
  $zaehler++;
  } //end while (!feof ($datei))

  // MORE CODE AFTER THIS
  // .

  }
  else
  {
?
  tr
  tdThe file ? echo $file[$i]; ? could not be
opened: no Mysql insert./td
  /tr
?
  }
  $i++;
  if ($datei)
  { fclose($datei); }
}

[/schnipp]

Warning messages are:

Warning: fopen(categories.txt,r+) - No such file or directory in *some
directory* on line 32


I hope anybody can help...

- Nessi -




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] fopen - warnings

2001-07-27 Thread Slavomir Slizik


...
if ($datei = @fopen($file[$i], r+))
...


On Thu, 26 Jul 2001, Vanessa wrote:

 Hello List,

 this is probably a very stupid question, but I dont know how to solve this
 little problem:
 I have a script with which text files (exported access db data sheets) can
 be uploaded to the mysql tables.
 It all works fine, but very annoyingly I get warning messages, if the text
 file is not resident on the server. But I want it in a way that it doesnt have
 to be on the server...a catch. The php manual says that if the file
 cannot be opened fopen returns false. All nice and good working, but I get
 those additional warning messages. Im not sure if it has maybe something
 to do with the server, but I am not convinced. Ill put the code below.
 Any suggestions are highly appreciated (I tried die command but it somehow
 messed up the routine).

 [schnipp]

 $file = array (colours.txt, categories.txt, stockmain.txt,
 stockcolours.txt);
 $i = 0;
 while ($file[$i])
 {
 //öffne das textfile
  $datei = ;

  if ($datei = fopen($file[$i], r+))
  {
  $zaehler = 0;
 //check wieviele zeilen das textfile hat
 //um zu verhindern, dass es leer ist!
  while (!feof ($datei)) //liest jede zeile einzeln mit fget()
  {
  $buffer = fgets($datei, 1000);
  //echo $buffer;
  //echo br;
  $zaehler++;
  } //end while (!feof ($datei))

  // MORE CODE AFTER THIS
  // .

  }
  else
  {
 ?
  tr
  tdThe file ? echo $file[$i]; ? could not be
 opened: no Mysql insert./td
  /tr
 ?
  }
  $i++;
  if ($datei)
  { fclose($datei); }
 }

 [/schnipp]

 Warning messages are:

 Warning: fopen(categories.txt,r+) - No such file or directory in *some
 directory* on line 32


 I hope anybody can help...

 - Nessi -




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] fopen - warnings

2001-07-26 Thread Vanessa

Hello List,

this is probably a very stupid question, but I dont know how to solve this
little problem:
I have a script with which text files (exported access db data sheets) can
be uploaded to the mysql tables.
It all works fine, but very annoyingly I get warning messages, if the text
file is not resident on the server. But I want it in a way that it doesnt have
to be on the server...a catch. The php manual says that if the file
cannot be opened fopen returns false. All nice and good working, but I get
those additional warning messages. Im not sure if it has maybe something
to do with the server, but I am not convinced. Ill put the code below.
Any suggestions are highly appreciated (I tried die command but it somehow
messed up the routine).

[schnipp]

$file = array (colours.txt, categories.txt, stockmain.txt, 
stockcolours.txt);
$i = 0;
while ($file[$i])
{
//öffne das textfile
 $datei = ;

 if ($datei = fopen($file[$i], r+))
 {
 $zaehler = 0;
//check wieviele zeilen das textfile hat
//um zu verhindern, dass es leer ist!
 while (!feof ($datei)) //liest jede zeile einzeln mit fget()
 {
 $buffer = fgets($datei, 1000);
 //echo $buffer;
 //echo br;
 $zaehler++;
 } //end while (!feof ($datei))

 // MORE CODE AFTER THIS
 // .

 }
 else
 {
?
 tr
 tdThe file ? echo $file[$i]; ? could not be 
opened: no Mysql insert./td
 /tr
?
 }
 $i++;
 if ($datei)
 { fclose($datei); }
}

[/schnipp]

Warning messages are:

Warning: fopen(categories.txt,r+) - No such file or directory in *some 
directory* on line 32


I hope anybody can help...

- Nessi -




Re: [PHP] fopen - warnings

2001-07-26 Thread david jarvis

try @fopen(categories.txt,r+);


- Original Message -
From: Vanessa [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 26, 2001 12:05 PM
Subject: [PHP] fopen - warnings


Hello List,

this is probably a very stupid question, but I dont know how to solve this
little problem:
I have a script with which text files (exported access db data sheets) can
be uploaded to the mysql tables.
It all works fine, but very annoyingly I get warning messages, if the text
file is not resident on the server. But I want it in a way that it doesnt
have
to be on the server...a catch. The php manual says that if the file
cannot be opened fopen returns false. All nice and good working, but I get
those additional warning messages. Im not sure if it has maybe something
to do with the server, but I am not convinced. Ill put the code below.
Any suggestions are highly appreciated (I tried die command but it somehow
messed up the routine).

[schnipp]

$file = array (colours.txt, categories.txt, stockmain.txt,
stockcolours.txt);
$i = 0;
while ($file[$i])
{
//öffne das textfile
 $datei = ;

 if ($datei = fopen($file[$i], r+))
 {
 $zaehler = 0;
//check wieviele zeilen das textfile hat
//um zu verhindern, dass es leer ist!
 while (!feof ($datei)) //liest jede zeile einzeln mit
fget()
 {
 $buffer = fgets($datei, 1000);
 //echo $buffer;
 //echo br;
 $zaehler++;
 } //end while (!feof ($datei))

 // MORE CODE AFTER THIS
 // .

 }
 else
 {
?
 tr
 tdThe file ? echo $file[$i]; ? could not be
opened: no Mysql insert./td
 /tr
?
 }
 $i++;
 if ($datei)
 { fclose($datei); }
}

[/schnipp]

Warning messages are:

Warning: fopen(categories.txt,r+) - No such file or directory in *some
directory* on line 32


I hope anybody can help...

- Nessi -




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] fopen - warnings

2001-07-26 Thread Taylor, Stewart

Assuming that your code works fine apart from the warning message you can
use @ so suppress any warning messages
e.g. @fopen(

-Stewart

-Original Message-
From: Vanessa [mailto:[EMAIL PROTECTED]]
Sent: 26 July 2001 17:06
To: [EMAIL PROTECTED]
Subject: [PHP] fopen - warnings


Hello List,

this is probably a very stupid question, but I dont know how to solve this
little problem:
I have a script with which text files (exported access db data sheets) can
be uploaded to the mysql tables.
It all works fine, but very annoyingly I get warning messages, if the text
file is not resident on the server. But I want it in a way that it doesnt
have
to be on the server...a catch. The php manual says that if the file
cannot be opened fopen returns false. All nice and good working, but I get
those additional warning messages. Im not sure if it has maybe something
to do with the server, but I am not convinced. Ill put the code below.
Any suggestions are highly appreciated (I tried die command but it somehow
messed up the routine).

[schnipp]

$file = array (colours.txt, categories.txt, stockmain.txt, 
stockcolours.txt);
$i = 0;
while ($file[$i])
{
//öffne das textfile
 $datei = ;

 if ($datei = fopen($file[$i], r+))
 {
 $zaehler = 0;
//check wieviele zeilen das textfile hat
//um zu verhindern, dass es leer ist!
 while (!feof ($datei)) //liest jede zeile einzeln mit
fget()
 {
 $buffer = fgets($datei, 1000);
 //echo $buffer;
 //echo br;
 $zaehler++;
 } //end while (!feof ($datei))

 // MORE CODE AFTER THIS
 // .

 }
 else
 {
?
 tr
 tdThe file ? echo $file[$i]; ? could not be 
opened: no Mysql insert./td
 /tr
?
 }
 $i++;
 if ($datei)
 { fclose($datei); }
}

[/schnipp]

Warning messages are:

Warning: fopen(categories.txt,r+) - No such file or directory in *some 
directory* on line 32


I hope anybody can help...

- Nessi -


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]