Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Senior Member Noteleklabs's Avatar
    Join Date
    Jun 2012
    Location
    NC
    Posts
    217
    Member #
    31890
    Liked
    28 times
    I am working on a small file manager, I have a php file named deleteop.php, it isn't working and I have tried everything. help?

    PHP Code:
    <?php
    echo '<div align="center"><p>Deleteing'.$_POST['file'].'</p></div>';
    $file $_GET["file"];
    if(
    unlink($file);) {
    header'Location: http://www.notelek.com/docs/liindex.php' ) ;
    }
    else {
    echo 
    'Do not Minipulate this url';
    }
    }
    ?>
    Hey you! Go make something!

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,716
    Member #
    5580
    Liked
    718 times
    Are you using $_GET or $_POST?

    Maybe we need to see what script is coming before the one you are showing?


  4. #3
    Senior Member Noteleklabs's Avatar
    Join Date
    Jun 2012
    Location
    NC
    Posts
    217
    Member #
    31890
    Liked
    28 times
    first off look at the title of this post,
    second I would kinda like to do post but I have an img tag with an a tag in front, here is the code on the script the variable is coming from:
    PHP Code:
    <?php

    $directory 
    'main';

    if (
    $handle opendir($directory.'/')) {
    echo 
    '<div id="directory">Directory: '.$directory.'</div><br />';
    echo 
    '<table><th><td width="185"><p>File Name</p></td><td width="210"><p>Delete</p></td><td width="185"><p>Edit</p></td><td width="185"><p>Rename</p></td></th></table>';
    echo 
    '<div id="divider"></div>';
    while (
    $file readdir($handle)) {
    if (
    $file!='.'&&$file!='..') {
    echo 
    '<table><tr><td width="200"><a href="'.$directory.'/'.$file.'">'.$file.'</a></td> <td width="200"><img src="delete.ico" /></td><td width="200"><img src="edit.ico" /></td><td width="200"><img src="rename.ico" /></td></tr></table>';
    echo 
    '<div id="divider"></div>';
    }
    }
    }
    echo 
    '</table>';
    ?>
    Hey you! Go make something!

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,716
    Member #
    5580
    Liked
    718 times
    In the script you showed, I don't see how clicking on <img src="delete.ico" /> will cause a file to be deleted.

    There must be some javascripting involved also?


  6. #5
    Senior Member Noteleklabs's Avatar
    Join Date
    Jun 2012
    Location
    NC
    Posts
    217
    Member #
    31890
    Liked
    28 times
    I was going to add a link like this: echo '<a href=http://www.notelek.com/docs/deleteop...ry.$file.&#39;></a>';
    Hey you! Go make something!

  7. #6
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,716
    Member #
    5580
    Liked
    718 times
    In that case, you would always be using $_GET, not $_POST

    But you'll have to make sure ... have a confirmation, "are you sure you want to delete it"?
    That <form> or question will then use $_POST. Not sure if you want an example or not.

    How secure does it have to be? Is this for only people who are logged in?



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:31 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com