Re: simple?

From: Date: Wed, 05 Nov 2003 20:28:08 +0000
Subject: Re: simple?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-168611@lists.php.net to get a copy of this message
Jason wrote:
Hello all, I have written a script for the purpose of uploading an image and block of text for a site. Real simple stuff but I can't get the form to write? code looks like this... <?php function is_upload_file($filename) {if (!$tmp_file = get_cfg_var('upload_tmp_dir')) { $tmp_file = dirname(tempnam(",")); } $tmp_file .= '/' . basename($filename); /*User might have trailing slash in php.ini...*/ return (ereg_replace(,/+, '/', $tmp_file ==$filename); } ?> I have some error checking above this but the meat of it still doesn't work. I get: Parse error: parse error in /var/www/html/site/directory/subdirectory/upload.php on line 68 in the upload.php file there are only 64 or so lines of code. HELP! Jason Jason - here is what I see straight off the bat..
return (ereg_replace(,/+, '/', $tmp_file ==$filename); should be return (ereg_replace(,/+, '/', $tmp_file ==$filename)); notice the second parenthesis at the end... i.e. return(ereg_replace()) that could possibly cause it to err out later... Rolf Brusletto www.phpExamples.net

« previous php.general (#168611) next »