GET_id not working in UnLink (delete file)
Discuss coding issues, and scripts related to PHP and MySQL.
-
JanMolendijk
- Posts: 282
- Location: Holland Rotterdam
GET_id not working in UnLink (delete file)
I searching for an hour for a solution; unlink seems not to work with GET id
Code: Select all
<?php
$id = (int) $_GET['id'];
echo $_GET['id'];
$file = fopen("'.$_GET['id'].'.txt","w");
echo fwrite($file,"Succesfully written document ticket);
fclose($file);
unlink("'.$_GET['id'].'.txt");
?>
Hope Coursesweb can help me out.
JanMolendijk
Posts: 282
Here is an answer `o god after 2 hours shame on me for this one`
Code: Select all
<?php
$file_pointer = $_GET[file].'.txt';
if (!unlink($file_pointer)) {
echo ("File can’t be deleted!");
} else {
echo ("File deleted!");
}
?>
Similar Topics
-
Multiple select for upload not working on mobile
JavaScript - jQuery - Ajax
First post
Plessant Coursesweb,
meight useless to ask but it seems this upload for picture-album is not working on my mobile-page
but on my computer I just...
Last post
Try to search on the internet for:
html multiple select upload mobile
-
XAMPP-server only local host working
General Forum
First post
Dear Coursesweb,
I have a problem after round 10 hours searching I come to you for suport.
Only the local host is working: //127.0.0.1
But I...
Last post
OK thanks MarPlo.... Wishing overseas nice weekend