I would like to delete a file in the file, and nothing is going well from the following error Strict standards: Only variables should be passed by reference could you guide me to solve this error? I'll be thankful! 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 photo:
Delete the photo // I made an include in the page "deletefotos.php" //
<?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));
}
?>