Matthew Oatham <mailto:[EMAIL PROTECTED]>
    on Monday, March 22, 2004 4:56 PM said:

> can anyone see any
> potential problems such as database problems, i.e duplicate keys, bad
> coding practices etc... cheers matt
> 
> if(!empty($_FILES["cr"])) {
>     $uploaddir = "cr/"; // set this to wherever
>     //copy the file to some permanent location
>     if (move_uploaded_file($_FILES["cr"]["tmp_name"], $uploaddir .
> $_FILES["cr"]["name"])) {
>         echo("file uploaded\n");
>         echo(generateCrId(insertChangeRequest()));
>     } else {
>         echo ("error!");
>     }
> }

yeah i see a few already. the following is better:

if(!empty($_FILES["cr"]))
{
        // code
}
else
{
        // other code
}

:P!!!!!!!!!!!!!!!!


chris.

p.s. no rebuttals please. there's nothing to say. kthxbye.

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

Reply via email to