RE: [PHP] Any Ideas?

From: Date: Tue, 23 Mar 2004 01:03:42 +0000
Subject: RE: [PHP] Any Ideas?
Groups: php.general 
Request: Send a blank email to php-general+get-181211@lists.php.net to get a copy of this message
Matthew Oatham <mailto:matthewoatham@hotmail.com> 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.

« previous php.general (#181211) next »