Jump to content

delete file error


nadman123

Recommended Posts

hey guys ..this is the code...

<?php      

   break;
   case "Delete":
?>
     <center>
       Confirm deletion of the following client record
     <br /></center><p />
     <table align="center" cellpadding="3">
     <tr />
       <td><b>Property NO</b></td>
       <td><?php echo $row["PROPERTY_ID"]; ?></td>
     </tr>
     <tr>
       <td><b>Property Address</b></td>
       <td><?php echo $row["PROPERTY_STREET"].
         " ".$row["PROPERTY_SUBURB"]; ?></td>
     </tr>
     </table>
     <br/>
     <table align="center">
     <tr>
       <td>
         <a style="text-decoration:none" href="PropertyModify.php?Property_id=<?php echo $row["PROPERTY_ID"]; ?>&Action=ConfirmDelete"><input type=button value=Confirm></a>
       </td>
       <td>
         <input type="button" value="Cancel" 
           OnClick="window.location='property.php'">
       </td>
     </tr>
     </table>
<?php
   break;

   case "ConfirmDelete":
     $query="DELETE FROM Property 
       WHERE Property_id =".$_GET["Property_id"];
       $stmt = oci_parse($conn,$query);
       unlink($row["PROPERTY_IMAGE"]);
     if(@oci_execute($stmt))
     {
?>
       <center>
         The following client record has been 
         successfully deleted<br />
<?php

       echo "Property No. ".$row["PROPERTY_ID"]
         ." ".$row["PROPERTY_STREET"]." ".$row["PROPERTY_SUBURB"];
       echo "</center>";
     }
     else
     {
       echo "<center>
          Error deleting property record</center><p />";
     }
     echo "<center><input type='button' 
         value='Return to List' 
         OnClick='window.location=\"property.php\"'>
         <center>";
   break;
 }
 oci_free_statement($stmt);
 oci_close($conn);
?>

 

 

and i get an error message called

Warning: unlink() [function.unlink]: Permission denied in e:\web\pro\PropertyModify.php on line 141
Link to comment
https://forums.phpfreaks.com/topic/125563-delete-file-error/
Share on other sites

actually the code is here..

 

<?php      
      
    break;
    case "Delete":
?>
      <center>
        Confirm deletion of the following client record
      <br /></center><p />
      <table align="center" cellpadding="3">
      <tr />
        <td><b>Property NO</b></td>
        <td><?php echo $row["PROPERTY_ID"]; ?></td>
      </tr>
      <tr>
        <td><b>Property Address</b></td>
        <td><?php echo $row["PROPERTY_STREET"].
          " ".$row["PROPERTY_SUBURB"]; ?></td>
      </tr>
      </table>
      <br/>
      <table align="center">
      <tr>
        <td>
          <a style="text-decoration:none" href="PropertyModify.php?Property_id=<?php echo $row["PROPERTY_ID"]; ?>&Action=ConfirmDelete"><input type=button value=Confirm></a>
        </td>
        <td>
          <input type="button" value="Cancel" 
            OnClick="window.location='property.php'">
        </td>
      </tr>
      </table>
<?php
    break;

    case "ConfirmDelete":
      $query="DELETE FROM Property 
        WHERE Property_id =".$_GET["Property_id"];
        $stmt = oci_parse($conn,$query);
        unlink($row["PROPERTY_IMAGE"]);
      if(@oci_execute($stmt))
      {
?>
        <center>
          The following client record has been 
          successfully deleted<br />
<?php
        
        echo "Property No. ".$row["PROPERTY_ID"]
          ." ".$row["PROPERTY_STREET"]." ".$row["PROPERTY_SUBURB"];
        echo "</center>";
      }
      else
      {
        echo "<center>
           Error deleting property record</center><p />";
      }
      echo "<center><input type='button' 
          value='Return to List' 
          OnClick='window.location=\"property.php\"'>
          <center>";
    break;
  }
  oci_free_statement($stmt);
  oci_close($conn);
?>

Link to comment
https://forums.phpfreaks.com/topic/125563-delete-file-error/#findComment-649204
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.