| Posted by Krustov on 07/14/06 14:43 
<comp.lang.php><Frankie>
 <Fri, 14 Jul 2006 02:53:51 GMT>
 <3HDtg.7339$ye3.7309@newsread1.news.pas.earthlink.net>
 
 > However, I need to use variables in this code.
 >
 > Specifically, I'm trying to do something like this:
 >
 > $pass=0;
 > $filename="../{$_POST['hfCategory']}/photos/{$_POST['hfItemNumber']}.jpg";
 > if (!file_exists($filename)) {$pass=1;}
 >
 > if ($pass==1) {unlink($filename);}
 >
 > ..but it's not working.
 >
 > Any additional advice appreciated.
 >
 
 I'd start by breaking it down a little .
 
 $temp1="$_POST['hfCategory']";
 print "temp1 = $temp1 <br>";
 
 $temp2="$_POST['hfItemNumber']";
 print "temp2 = $temp2 <br>";
 
 $filename="$temp1/photos/$temp2" . ".jpg";
 
 Making sure you have the path 100% correct is the first step .
 
 TMK "../" doesnt need to be used unless you have good reason to do so .
 
 
 --
 Encrypted email address
 www.emailuser.co.uk/?name=KRUSTOV
  Navigation: [Reply to this message] |