Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Is PHP secure?

  1. #1
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default Is PHP secure?

    I don't know much about PHP, but I was woundering how secure it is for tasks like holding user infromation and passwords, etc.

    Can anyone offer shed some light here?
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    PHP is secure... to a point. It's completely invisible to the user when executed as a file on the web. But a determined hacker could probably get it, no matter what. But it's definitely better then JavaScript for password/username validation.

    Example:
    Code:
    <?php echo "test"; ?>
    would be outputted on the web as "test". Even if you hit view source, you'd only see the "test".
    - Mike

  3. #3
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Quote Originally Posted by mburt View Post
    But a determined hacker could probably get it, no matter what.
    Only if you either show them the source code, or they gain access to your server (which your php scripts are hosted on). Although, if you have any decent webhost, you shouldn't need to worry too much about this.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  4. #4
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    or they gain access to your server (which your php scripts are hosted on)
    Bingo. Try typing in Index Of: /etc in google
    - Mike

  5. #5
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Wow, that's a lot of sites. They either run their own server, or have crappy webhosts/ISPs, or both!
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  6. #6
    Join Date
    Jul 2006
    Posts
    95
    Thanks
    21
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by mburt View Post
    Bingo. Try typing in Index Of: /etc in google
    Is there a way to check if my site is one of them?

  7. #7
    Join Date
    Jan 2007
    Location
    Bournemouth, England
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yes, create a directory with some random files in it, none called index or something that will redirect the browser if you type in http://www.whatever.com/directory/

    And if when you type that in it shows a list of all the files in the directory then they could get access to your php scripts.

    On my webhost (streamline.net) it says cannot show directory contents.

  8. #8
    Join Date
    Jun 2006
    Location
    Acton Ontario Canada.
    Posts
    677
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    - Ryan "Boxxertrumps" Trumpa
    Come back once it validates: HTML, CSS, JS.

  9. #9
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    PHP has a long history of security issues. It's widely considered rather insecure.

    PHP flaws aside, though, it's as secure as you write it.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #10
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    More secure than javascript. Heck, javascript doesn't even try to be secure.
    - Mike

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •