Getting a warning line in directory.

Discussion in 'PHP' started by Mahumba, Nov 14, 2006.

  1. #1
    Hi,

    I set up a small fishing directory and I'm getting a warning line at the top of the page.

    Can someone check it out and let me know what it means and how I can fix and or get rid of it?

    Here's where it is: Fishing directory

    Thanks.

    Roger
     
    Mahumba, Nov 14, 2006 IP
  2. Richie_Ni

    Richie_Ni Illustrious Member

    Messages:
    10,721
    Likes Received:
    1,175
    Best Answers:
    0
    Trophy Points:
    410
    #2
    Awesome URL...
    Have no idea about that & have never heard about that script.
    I'd recommend you use phpld which is very very popular.
     
    Richie_Ni, Nov 14, 2006 IP
    m0rtal likes this.
  3. Mahumba

    Mahumba Peon

    Messages:
    72
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I have just down loaded that directory. I'll set it up tonight. Thanks for the link!

    Roger
     
    Mahumba, Nov 14, 2006 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    The number in the second argument is higher than the number of array keys from the array in the first argument. Post your code if you need help.
     
    nico_swd, Nov 14, 2006 IP
  5. Madcow

    Madcow Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    i got the response :
    "
    Warning: array_rand() [function.array-rand]: Second argument has to be between 1 and the number of elements in the array in /hermes/web07/b2934/pow.mahumba/directory/htdocs/directory on line 381
    "
    from your page.


    Did you tried using a "@" sign before the array_rand() function.

    old one should be like array_rand();

    using @array_rand() should work for your problem.

    PS: Also i'm seeing that the sacond argument in array_rand() function that you are using is invalid ...

    Cya
    Irmak
     
    Madcow, Nov 15, 2006 IP
  6. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #6
    The @ operator is not a good solution, specially for something that can probably be fixed very easily. It might prevent the script from working correctly, and you wouldn't even know cause you're telling the script to be silent.
     
    nico_swd, Nov 15, 2006 IP
  7. Madcow

    Madcow Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I know its the solution for limited time for visitors to not seeing useless errors...
     
    Madcow, Nov 15, 2006 IP