2
i would like to delete a file in the file, and nothing is going well of the following Strict standards error: Only variables should be passed by Ference could you guide me to resolve this error? I’ll be grateful! Image link:
<a id="photo-'.$resultfotos['id'].'" href="site.php?userid='.$user_id.'&pageid='.$page.'&fotoid='.$resultfotos['id'].'">
<img src="uploads/photos/'.$resultfotos['foto'].'"/>
</a>
Link to delete the photo:
Delete the photo //I made a include on the "deletefotos.php page"//
<?php
$image = end(explode('-',$_GET['photo']));
$result = Pagina::minhaFoto($imagem,$user_id);
if($result['res']){
if(Pagina::delFoto($idDaimagem)){
if(file_exists('../uploads/photos'.$result['foto'])){
unlink('../uploads/photos'.$result['foto']);
}
}
} ?>
page class, page.class.php
<?php
static function minhaFoto($imagem){
$select = self::getConn()->prepare('SELECT `pagina` FROM `fotos` WHERE `id`=? LIMIT 1');
$select->execute(array($imagem));
if($select->rowCount()==1){
$asfoto = $select(PDO::FETCH_ASSOC);
$dados['res'] = self::myEvent($asfoto['pagina'],$user_id);
$dados['foto'] = $asfoto['foto'];
return $d;
}
}
static function delFoto($idDaimagem){
$del = self::getConn()->prepare('DELETE FROM `fotos` WHERE `id`=?');
return $del->execute(array($idDaimagem));
}
?>
If any question solved the problem mark it as accepted, see more details on: How and why to accept an answer?
– rray