RE: [PHP-WIN] Can't figure out how to surpress this error
| From: | Ed Lazor | Date: | Mon, 13 Sep 2004 18:07:26 +0000 |
| Subject: | RE: [PHP-WIN] Can't figure out how to surpress this error | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-24562@lists.php.net to get a copy of this message | ||
Line 0 makes me wonder if you have a space or something before the opening
php tag, especially the part about headers already sent.
> -----Original Message-----
> From: Ron.Herhuth@tatumpartners.com [mailto:Ron.Herhuth@tatumpartners.com]
> Sent: Monday, September 13, 2004 6:09 AM
> To: php-windows@lists.php.net
> Subject: [PHP-WIN] Can't figure out how to surpress this error
>
>
> I have a page that has a form allowing users to upload a file. The
> following page processes the information they entered checking all form
> fields with "isset" before attempting to process any of the information.
> The script works fine EXCEPT when the user does NOT upload a file...then
> the page displays this error:
>
> "PHP Notice: No file uploaded in Unknown on line 0 PHP Warning: Cannot
> send session cache limiter - headers already sent in
> E:\tatumpartners\tcms_admission\public_site_email_contact_process.php on
> line 2 "
>
> The problem is that everything still processes correctly in all
> cases...but the error is still displayed and this looks bad from the
> user's perspective.
>
>
> This is the code that handles the file upload:
>
> if(isset($_FILES['userfile']) &&
> $_FILES['userfile']['name'] !="")
> {
> $file_url1 = $_FILES['userfile']['tmp_name'];
> $file_name1 = $_FILES['userfile']['name'];
> $file_type1 = $_FILES['userfile']['type'];
>
> $fp1 = fopen($file_url1,"r");
> $str1 = fread($fp1, filesize($file_url1));
> $str1 = chunk_split(base64_encode($str1));
> $message .= "--MIME_BOUNDARY\n";
> $message .= "Content-Type: $file_type1 ; name=\"$file_name1\"\n";
> $message .= "Content-disposition: attachment\n";
> $message .= "Content-Transfer-Encoding: base64\n";
> $message .= "\n";
> $message .= "$str1\n";
> $message .= "\n";
> }
>
>
>
> Is there anyway other than what I have done here to surpress the error
> message from displaying?
>
>
> Thanks,
> Ron
>
>
>
>