Alright so I have this script that was written by the person that I replaced and I need some help.
There is a trash can icon that when you click on it is supposed to delete an image. However....when I click on the icon, it sends me to a 404 Not Found page. (but the image is infact at its location)
The end of the url that is linked to the icon says:
/exh.img.del?f=e xh.image0529484 001178137571.jp g
This is the code I've been looking at for "exh.img.del.php"
and I just want to know if there is 'anything' at all wrong with this script:
[code=php]
<?
$myFile = mysql_escape_st ring($_REQUEST['f']);
$naa = $myFile;
unlink($myFile) ;
require('../../inc/baza.php');
$link = mysql_connect($ host, $user, $pass, false, MYSQL_CLIENT_CO MPRESS);
$alive = mysql_ping();
if(!$alive) {
echo "MySQL is not alive\n";
} else {
mysql_select_db ($dbName, $link) or die("Cant connect to database");
$q = "DELETE FROM images WHERE imgStamp='$naa' ";
$r = mysql_query($q) or die ("Couldnt execute query.");
}
$_SESSION['gTab'] = "tab5";
$_SESSION['imgWhat'] = "add.new";
$strana2 = "../../admin/admin.php?p=exh &pp=exh&goo=edi t.full";
header("Locatio n: $strana2");
?>[/code]
[Please use CODE tags when posting source code. Thanks! --pbmods]
There is a trash can icon that when you click on it is supposed to delete an image. However....when I click on the icon, it sends me to a 404 Not Found page. (but the image is infact at its location)
The end of the url that is linked to the icon says:
/exh.img.del?f=e xh.image0529484 001178137571.jp g
This is the code I've been looking at for "exh.img.del.php"
and I just want to know if there is 'anything' at all wrong with this script:
[code=php]
<?
$myFile = mysql_escape_st ring($_REQUEST['f']);
$naa = $myFile;
unlink($myFile) ;
require('../../inc/baza.php');
$link = mysql_connect($ host, $user, $pass, false, MYSQL_CLIENT_CO MPRESS);
$alive = mysql_ping();
if(!$alive) {
echo "MySQL is not alive\n";
} else {
mysql_select_db ($dbName, $link) or die("Cant connect to database");
$q = "DELETE FROM images WHERE imgStamp='$naa' ";
$r = mysql_query($q) or die ("Couldnt execute query.");
}
$_SESSION['gTab'] = "tab5";
$_SESSION['imgWhat'] = "add.new";
$strana2 = "../../admin/admin.php?p=exh &pp=exh&goo=edi t.full";
header("Locatio n: $strana2");
?>[/code]
[Please use CODE tags when posting source code. Thanks! --pbmods]
Comment