|
|
#1 (permalink) |
|
Bow before Surpass!
Super #1
Joined in Sep 2004
1,544 posts
Gave thanks: 91
Thanked 49 times
|
PHP Random Text
Well, I've been checking via Google and such, but there is no help... either has information on random numbers or inefficient ways to make random things...
Anyone have a simple, easy customize, php code for randomly displaying text (changes on reload)? I might just go java...
__________________
Wii Hotspot - Upcoming project! -http://www.wiihotspot.com
Make a cPanel Login Form | Why is my Account Suspended? |
|
|
|
|
|
#2 (permalink) |
|
Skittles
Super #1
Joined in Aug 2004
Lives in a space ship
Hosted on dedi
6,723 posts
Gave thanks: 98
Thanked 190 times
|
what kind of text are you looking to display? If you have like a few phrases, I would say just use a switch and a random number to pick one to display or use.
__________________
Mountain Dew Knight
People should not be afraid of their governments. Governments should be afraid of their people. |
|
|
|
|
|
#3 (permalink) |
|
Race Surpass
Super #1
Joined in Jul 2006
Lives in Oklahoma City, OK
Hosted on sh102
1,219 posts
Gave thanks: 18
Thanked 86 times
|
Here's what I use to spit out a 5 character image from randomly generated text. You could probably put the chr(rand(48,126)) part inside a loop to generate however many characters you needed and dump all the image stuff and just echo out $code if all you wanted was the text.
PHP Code:
__________________
|
|
|
|
|
|
#4 (permalink) |
|
Yabadabadoo
Super #1
Joined in Nov 2004
Lives in B.C., Canada
Hosted on Dedicated
1,013 posts
Gave thanks: 7
Thanked 28 times
|
wait, are these set phrases that you want to display randomly? or you just want a random word showing up much like a bot-deterant thing
|
|
|
|
|
|
#5 (permalink) |
|
Registered User
Super #1
Joined in Mar 2005
Lives in Washougal, WA
1,306 posts
Gave thanks: 23
Thanked 39 times
|
Hey MarkRH, could anyone use that, if so, I may if I can get my contact form up, implement that for verification, way better then what I had.
Thanks. |
|
|
|
|
|
#6 (permalink) |
|
Race Surpass
Super #1
Joined in Jul 2006
Lives in Oklahoma City, OK
Hosted on sh102
1,219 posts
Gave thanks: 18
Thanked 86 times
|
Sure.. just include it (a separate php file) as the src of an img tag. Add a field in the form to accept input from the user.. and then check the value in the form field against the session variable. Most bots don't even request the php file and the session variable doesn't even exist.
It's in action on my guestbook. I reset my guestbook log at 10:23 this morning and 55 failed attempts so far.
__________________
|
|
|
|
|
|
#8 (permalink) |
|
Bow before Surpass!
Super #1
Joined in Sep 2004
1,544 posts
Gave thanks: 91
Thanked 49 times
|
Thanks for the help, sorry I never replied!
I foudn a solution from using a .txt that had a word on each line. Basically, it would display a random image, but this image was made of three different ones... so a random word would define the name of the image for all three. Thanks for the help though! ![]()
__________________
Wii Hotspot - Upcoming project! -http://www.wiihotspot.com
Make a cPanel Login Form | Why is my Account Suspended? |
|
|
|
|
|
#9 (permalink) |
|
Surpass Fan
On a golden path...
Joined in Oct 2004
Lives in UK
356 posts
Gave thanks: 6
Thanked 13 times
|
try the one here http://www.dagondesign.com/articles/...mailer-script/ it includes a full custom form as well
__________________
D17/D21/P59/P62/VPSX - "Faith can move mountains" (Faiths a big girl....) - I'm not paranoid, I know they are out to get me! |
|
|
|