Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17

Thread: PHP Problems

  1. #1
    Dan
    Dan is offline
    Member
    Join Date
    Feb 2003
    Posts
    39
    Member #
    707
    I'm having a bit of trouble with a script of mine. (Actually some people helped write it. :P) The problem is that it loops through half the directory and stops, and then view.php just doesn't really even work..

    The page: http://animebeta.com/dotdan3_/

    The PHPS files:
    /view.phps
    /list.phps

  2.  

  3. #2
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,656
    Member #
    1234
    Liked
    137 times
    OK, stupid comment #1: I think you have to initialize $number. Don't ask me why, just a gut feeling, code just doesn't feel right.

    Evil code maybe? GL with it!
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com

  4. #3
    Dan
    Dan is offline
    Member
    Join Date
    Feb 2003
    Posts
    39
    Member #
    707
    Initialize it? I have no clue what you mean, but it's just part of a foreach. =\ But yeah, the code is messed up..

  5. #4
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    You don't need to... I don't know what's up =x

    The foreach is the $key => $value, I've used it many times without intializing...

    However this line is fishy: while(false !== readdir($handle))


    I think you're going for while(!readdir($handle)) What you have right now makes no sense... != is valid, == is valid, but !== isn't valid.
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  6. #5
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,656
    Member #
    1234
    Liked
    137 times
    Initialize means to set a variable to a default value to ensure it is a known value.
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com

  7. #6
    Dan
    Dan is offline
    Member
    Join Date
    Feb 2003
    Posts
    39
    Member #
    707
    Brak, I tried that and now it doesn't work at all.

    Edit: I changed it back with != and it's the same as before.

  8. #7
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    whopes... I forgot you wanted it true... : while(readdir($handle))
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  9. #8
    Dan
    Dan is offline
    Member
    Join Date
    Feb 2003
    Posts
    39
    Member #
    707
    Tried it, still no dice. =\

  10. #9
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    I recall some special note about readdir in the PHP manual...try:
    PHP Code:
    while (readdir($handle) !== false
    Also see http://www.php.net/readir .
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  11. #10
    Dan
    Dan is offline
    Member
    Join Date
    Feb 2003
    Posts
    39
    Member #
    707
    I tried that.. still, oddly enough, it only lists half the files. =\


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:53 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com