You are here: Re: Advice on deleting images from server using PHP « PHP Programming Language « IT news, forums, messages
Re: Advice on deleting images from server using PHP

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация