My randomizing code doesn't work off-line

后端 未结 1 448
醉话见心
醉话见心 2021-01-29 12:20

I\'m a php noob and I just made a little script from some other scripts I found on the net. It picks 3 random images from a folder named \"Random\" and shows them.

While

相关标签:
1条回答
  • 2021-01-29 12:40

    If your only problem is the undefined variable, it's easy.

    The server settings are different on your local and remote servers so one returns the error and the other doesn't, but when you ask !$random2 before it exists it will return an error.

    So simply set $random2 to false before the while loop.

    The same goes for $random3.

    0 讨论(0)
提交回复
热议问题