Follow us on Twitter!
The important thing is not to stop questioning. - Albert Einstein
Saturday, December 03, 2016
Navigation
Home
 Find:
 Information:
Learn
Communicate
Submit
Shop
Challenges
 Exploit:
 Programming:
 Think:
 Track:
 Patch:
 Other:
 Need Help?
Other
Members Online
Total Online: 38
Guests Online: 37
Members Online: 1

Registered Members: 96758
Newest Member: monez2020
Latest Articles
View Thread

HellBound Hackers | HellBound Hackers | Questions

Author

The saying that changes under the logo


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 28-12-09 17:42
Hey, I'm designing a web page, and i was wondering how they got the saying under the logo to change every time you reload the page. I would like to have the same thing in my web page
Author

RE: The saying that changes under the logo


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 28-12-09 17:48
random number generator + array full of sayings.

Fill the array with a textfile btw (like fortune).


Author

RE: The saying that changes under the logo


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 28-12-09 18:07
... or, if you want to really make it interesting:

Get an array of subjects, array of verbs, and array of predicates, and use those to randomly generate "quotes". Then, use the names of famous politicians of the past to attribute the "quote" for bonus humor points.


Author

RE: The saying that changes under the logo


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 28-12-09 18:09
define wrote:
... or, if you want to really make it interesting:

Get an array of subjects, array of verbs, and array of predicates, and use those to randomly generate "quotes". Then, use the names of famous politicians of the past to attribute the "quote" for bonus humor points.


To make it even better use a markov chain. Anyways, here's some code

Code
<?PHP
$file = file_get_contents('file.txt');
$lines = explode("\n",$file);
echo $lines[mt_rand(0,count($lines)-1)]."\n";
?>





Will read lines from "file.txt" and print out a random line.




Edited by on 28-12-09 18:20