Jump to content


Photo

Deleting File


  • Please log in to reply
1 reply to this topic

#1 SkyRanger

SkyRanger

    Advanced Member

  • Members
  • PipPipPip
  • 634 posts

Posted 23 January 2013 - 03:47 PM

I am trying to delete files but not sure why this is not working.

while($row = $result->fetch_assoc()){
$file1 = $row['pic'];
$file2 = $row['pic2'];
$file3 = $row['pic3'];
}

echo $loggedin;

echo $file1;
echo $file2;
echo $file4;

unlink('members/$loggedin/inventory/$file1');
unlink('members/$loggedin/inventory/$file2');
unlink('members/$loggedin/inventory/$file3');


All of the echo's display the proper info but I get the error

Warning: unlink(members/$loggedin/inventory/$file1)
Warning: unlink(members/$loggedin/inventory/$file2)
Warning: unlink(members/$loggedin/inventory/$file3)

Edited by SkyRanger, 23 January 2013 - 03:49 PM.

If you search for it, it may be there.

Ensure you use < > button before inserting code for easy reading.

A wise Lady Guru keeps reminding me if you have a select problem: READ THIS

#2 BagoZonde

BagoZonde

    Advanced Member

  • Members
  • PipPipPip
  • 67 posts

Posted 23 January 2013 - 03:56 PM

Wrong use of quotations, there's a big difference between " and ' marks. You should check this regarding to using variables inside.
A=1-A ...from Basic...
$a=1-$a ...thru PHP...
LDA $01 EOR #1 ...to 6502 ASM :}

Does it mean I'm going low-level?! ;]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com