Error Message - Uploading Files

A

Anonymous

Guest
147 switch($task)
148
149 {
150
151 case 'upload':
152 upload($the_file);
153 break;
154 default:
155 form();
156
157 }

Why is it displaying THIS error????

Warning: Undefined variable: task in c:\dev\intranet\news\easy-uploads.php on line 147

It works perfect but it obviosuly doesnt look right with an error msg. i try taking it out, the whole upload doesnt work!

Cheers
 
AaaDee said:
147 switch($task)
148
149 {
150
151 case 'upload':
152 upload($the_file);
153 break;
154 default:
155 form();
156
157 }

Why is it displaying THIS error????

Warning: Undefined variable: task in c:\dev\intranet\news\easy-uploads.php on line 147

It works perfect but it obviosuly doesnt look right with an error msg. i try taking it out, the whole upload doesnt work!

Cheers

Hi Adam!
I think that you using last version of PHP... Correct?
In a last version of PHP you have a problem with unsetting variables, try to using next:
Code:
if (isset($task)) {$task='upload'}

switch($task)
{
case 'upload':
upload($the_file);
break;
default:
form();
}
And once more, if you no use more variants use if .... else
 
Back
Top