NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page random generator

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 03-20-2006, 04:56 PM THREAD STARTER               #1 (permalink)
NamePros Regular
 
Something Vague's Avatar
Join Date: Mar 2006
Posts: 887
Something Vague is a jewel in the roughSomething Vague is a jewel in the roughSomething Vague is a jewel in the rough
 



random generator


http://www.insultmonger.com/generators/index.htm

can anyone create a script similar to that process? the ability to push a button, and it randomly displays a line of words from a database. If someone can PM me a script of this, or code it, they're a great person, and I would be glad to give rep points, maybe some NP.

I really need a script like this!
Something Vague is offline  
Old 03-20-2006, 05:34 PM   #2 (permalink)
Senior Member

Join Date: Apr 2005
Location: .ma.us
Posts: 1,880
DropLister has much to be proud ofDropLister has much to be proud ofDropLister has much to be proud ofDropLister has much to be proud ofDropLister has much to be proud ofDropLister has much to be proud ofDropLister has much to be proud ofDropLister has much to be proud of
 


Baby Health Save a Life Save The Children
try something like this, i use it for a random domain generator

the text file consists of one entry per line

<?
//Text files to use
$textfile ="http://www.droplister.com/dom_list1.txt";

//Let's randomize these words
$rand = file("$textfile");
$rando = rand(0, sizeof($rand)-1);

?>
<a class="reload" href="javascript: window.location.reload()"><img src="Your Button"></a> for another.
<textarea>
<?
//Print the random name
echo $rand[$rando];
?>
</textarea>
__________________
Last edited by droplister; 03-20-2006 at 06:52 PM.
DropLister is offline  
Old 03-20-2006, 05:52 PM THREAD STARTER               #3 (permalink)
NamePros Regular
 
Something Vague's Avatar
Join Date: Mar 2006
Posts: 887
Something Vague is a jewel in the roughSomething Vague is a jewel in the roughSomething Vague is a jewel in the rough
 



Hi,

Look at the quick reply box here at namepros. Image that "message;" says "Word Generator" and the box where you type the message displays "random text here". Then if I hit a button like "Post Quick Reply" it displays another "random text here" without loading the entire page again. Just the text in the box changes.

DO you know what I mean? Can you edit your script to suit said needs? I really like how it picks from a text list! Fantastic!
Last edited by Something Vague; 03-20-2006 at 06:05 PM.
Something Vague is offline  
Old 03-20-2006, 06:29 PM   #4 (permalink)
NamePros Regular
 
Jim_'s Avatar
Join Date: Aug 2005
Location: NY, USA
Posts: 610
Jim_ is a splendid one to beholdJim_ is a splendid one to beholdJim_ is a splendid one to beholdJim_ is a splendid one to beholdJim_ is a splendid one to beholdJim_ is a splendid one to behold
 


Save The Children
The script is loaded inside an iframe on that page. The go button just reloads the page inside the iframe.
__________________
ask me about the internet
Jim_ is offline  
Old 03-20-2006, 06:48 PM THREAD STARTER               #5 (permalink)
NamePros Regular
 
Something Vague's Avatar
Join Date: Mar 2006
Posts: 887
Something Vague is a jewel in the roughSomething Vague is a jewel in the roughSomething Vague is a jewel in the rough
 



Can anyone integrate this script where the random results are in a text box, and the reload action is an image (like a .gif saying GO!, not button)?
Something Vague is offline  
Old 03-20-2006, 06:59 PM   #6 (permalink)
NamePros Regular
 
Jim_'s Avatar
Join Date: Aug 2005
Location: NY, USA
Posts: 610
Jim_ is a splendid one to beholdJim_ is a splendid one to beholdJim_ is a splendid one to beholdJim_ is a splendid one to beholdJim_ is a splendid one to beholdJim_ is a splendid one to behold
 


Save The Children
page:
Code:
<a href="script.php" target="_box"><img src="go.gif" /></a>
<iframe name="_box" src="script.php" width="400" height="50" frameborder="0"></iframe>
script.php:
PHP Code:
<?php
$textfile 
="http://www.droplister.com/dom_list1.txt";

$rand file("$textfile");
????: NamePros.com http://www.namepros.com/programming/178878-random-generator.html
$rando rand(0sizeof($rand)-1);

echo 
$rand[$rando];
?>
__________________
ask me about the internet
Jim_ is offline  
Old 03-20-2006, 07:27 PM THREAD STARTER               #7 (permalink)
NamePros Regular
 
Something Vague's Avatar
Join Date: Mar 2006
Posts: 887
Something Vague is a jewel in the roughSomething Vague is a jewel in the roughSomething Vague is a jewel in the rough
 



Wicked, thank you Jim. Rep added!
Something Vague is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 02:16 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger