RE: [PHP] 4.0.6 to 4.3.0

2003-02-07 Thread Rich Gray

 Any thoughts as to why this snippet:

 25: if ($attach != none)
 26:  {
 27:$file = fopen($attach, r);
 28:$contents = fread($file, $attach_size);
 29:$encoded_attach = chunk_split(base64_encode($contents));
 30:fclose($file);

 would produce these errors:

 Warning: fread(): supplied argument is not a valid stream resource in
 /usr/virtual/share/pkgs/installed/aeromail/1.40/aeromail/send_mess
 age.php on line 28

 Warning: fclose(): supplied argument is not a valid stream resource in
 /usr/virtual/share/pkgs/installed/aeromail/1.40/aeromail/send_mess
 age.php on line 30

 After upgrading from 4.0.6 to 4.3.0


Most probably because with 4.3.0 register_globals is set to OFF by default -
where does $attach get set?

Rich


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] 4.0.6 to 4.3.0

2003-02-07 Thread Brian V Bonini
On Fri, 2003-02-07 at 09:44, Rich Gray wrote:
 
  Any thoughts as to why this snippet:
 
  25: if ($attach != none)
  26:  {
  27:$file = fopen($attach, r);
  28:$contents = fread($file, $attach_size);
  29:$encoded_attach = chunk_split(base64_encode($contents));
  30:fclose($file);
 
  would produce these errors:
 
  Warning: fread(): supplied argument is not a valid stream resource in
  /usr/virtual/share/pkgs/installed/aeromail/1.40/aeromail/send_mess
  age.php on line 28
 
  Warning: fclose(): supplied argument is not a valid stream resource in
  /usr/virtual/share/pkgs/installed/aeromail/1.40/aeromail/send_mess
  age.php on line 30
 
  After upgrading from 4.0.6 to 4.3.0
 
 
 Most probably because with 4.3.0 register_globals is set to OFF by default -
 where does $attach get set?
 


Nope, I do have register_globals on in php.ini

Its being set in another file like this:
form enctype=multipart/form-data name-doit action=send_message.php
method=POST

input type=file name=attach size=68

It behaves like, if ($_GET['attach'] != none) or ($attach != none)
is always true.

If I attach something it goes through no prob, if I do not attach something
it still goes through but with all the error messages and an empty attachment
at the recieving end. Only thng that has changes was upgrading PHP from 4.0.6
to 4.3.0

-B


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] 4.0.6 to 4.3.0

2003-02-07 Thread Rich Gray
[snip]
  
   After upgrading from 4.0.6 to 4.3.0
  
 
  Most probably because with 4.3.0 register_globals is set to OFF
 by default -
  where does $attach get set?
 


 Nope, I do have register_globals on in php.ini

 Its being set in another file like this:
 form enctype=multipart/form-data name-doit action=send_message.php
 method=POST

 input type=file name=attach size=68

 It behaves like, if ($_GET['attach'] != none) or ($attach != none)
 is always true.

 If I attach something it goes through no prob, if I do not attach
 something
 it still goes through but with all the error messages and an
 empty attachment
 at the recieving end. Only thng that has changes was upgrading
 PHP from 4.0.6
 to 4.3.0

Hi Brian

Why are you using $_GET[] when your form is submitting via the 'post'
method? Secondly for file uploads why are you not using the $_FILES[]
superglobal array?

Rich


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] 4.0.6 to 4.3.0

2003-02-07 Thread Brian V Bonini
On Fri, 2003-02-07 at 10:13, Rich Gray wrote:

 Hi Brian
 
 Why are you using $_GET[] when your form is submitting via the 'post'
 method?

My bust, just a typo. It's actually: if ($attach != none) that is
beign used anyway.

 Secondly for file uploads why are you not using the $_FILES[]
 superglobal array?

I did not write the app, just trying to figure out why it stopped
working after upgrading PHP. You think that's the problem?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] 4.0.6 to 4.3.0

2003-02-07 Thread Rich Gray
  Secondly for file uploads why are you not using the $_FILES[]
  superglobal array?
 
 I did not write the app, just trying to figure out why it stopped
 working after upgrading PHP. You think that's the problem?

Well try  ...

if (is_uploaded_file($_FILES['attach']['tmp_name'])) {
// Blah Blah Blah
}

Rich 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php