php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11319 weird if/unlink thing
Submitted: 2001-06-06 15:32 UTC Modified: 2001-06-07 04:42 UTC
From: jf dot bethlehem at wanadoo dot nl Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: 4.0.5 OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jf dot bethlehem at wanadoo dot nl
New email:
PHP Version: OS:

 

 [2001-06-06 15:32 UTC] jf dot bethlehem at wanadoo dot nl
i noticed, that with this code, the $user file still gets
unlinked.

the file DOES exist, "test" does NOT get printed, and there
is no message of "user deleted" or "can't unlink".

For the rest, it's a standard debian install of php, with
the newest version of php installed (nightly update, regular upgrade).

(this code is part of an administration script, which adds
and deletes users)

code sample
=====
        if(!strcmp($adddelete, "delete"))
        {
                if(file_exists($user))
                {
                        echo "test";
                        if(unlink($user))
                        {
                              echo "user deleted.<br>";
                        }
                        else
                        {
                              //error
                              echo "can't unlink<br>";
                        }
                }
                else
                {
                     //error
                     echo "$user doesn't exist<br>";
                }
        }
        else
        {
               //error
               echo "wrong input<br>";
       }
====
end code sample


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-07 04:42 UTC] sniper@php.net
I can't reproduce this. I tried this in cmd line and 
"test" is printed. Try PHP 4.0.6RC2 from here:

http://www.php.net/~andi/php-4.0.6RC2.tar.gz

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC