RE: [PHP-WIN] explode!

From: Date: Sun, 18 Mar 2001 22:07:23 +0000
Subject: RE: [PHP-WIN] explode!
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-6122@lists.php.net to get a copy of this message
I think hat you have a problem with the "/". The path in the database is ok with the "/", but if you add that path, to the local "c:\inet..." it will not work, because the "/" must be "\". Why dont you put the field in a string variable and replace the "/" with "\" ? Scotty. -----Mensaje original----- De: Bacon Luvva [mailto:futureworlds@btinternet.com] Enviado el: Sabado, 17 de Marzo de 2001 05:38 p.m. Para: PHP Asunto: [PHP-WIN] explode! I have a news database. One of the fields in the database is a field that describes the path to an image on the server. ie: ../images/imagefile.gif I have a script that deletes news stories from the database and this is where I am stuck. Everything works okay when deleting the story but when it comes to the deletion of the image file... no go. I have used the unlink function if ( ! ($delimage=unlink($imagefield))) { DisplayErrMsg(sprint("internal error %d:%s\n", mysql_errno(), mysql_error())); exit(); } The function fails with: Warning: Unlink failed (No such file or directory) in c:\Inetpub\wwwroot/news/admin/delete_news.php on line 24 internal error 0: I know that the info in the database is a URL (../images/imagefile.gif) and not an actual path. Is there a way to strip the url back to the image name and replace it with the path so the file can be removed?. I have explored the possibilities of the explode function and believe this is the function I need to use? (so far without much success!) Thus I have come to you fine folk for some help on how I might do this. Grateful for any pointers on this one, Regards, Karl. -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net For additional commands, e-mail: php-windows-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.windows (#6122) next »