Delete file using a link

Posted by user329394 on Stack Overflow See other posts from Stack Overflow or by user329394
Published on 2010-05-07T03:39:52Z Indexed on 2010/05/07 3:48 UTC
Read the original article Hit count: 156

Filed under:

Hi all,

i want to have function like delete file from database by using link instead of button. how can i do that? do i need to use href/unlink or what? Can i do like popup confirmation wther yes or no. i know how to do that, but where should i put the code?

this is the part how where system will display all filename and do direct upload. Beside each files, there will be a function for 'Remove':

$qry = "SELECT * FROM table1 a, table2 b
       WHERE b.id = '".$rs[id]."' AND a.ptkid = '".$rs[id]."' ";
$sql = get_records_sql($qry);
foreach($sql as $rs){ ?>              
        <?echo '<a href="download.php?f='.$rs->faillampiran.'">'. basename($rs->faillampiran).'</a>';
        ?><td><?echo '<a href="">      [Remove]</a>';?></td><?
        ?><br>  
        <? } 
        ?>

thankz all

© Stack Overflow or respective owner

Related posts about php