Neutrality
Feb 24 2005, 02:49 AM
| | Here comes another one of Inspired's "amazing" PHP scripts. This little script lets you display a random message every time the user visits that particular page. It's not really that useful, but it does make the page a bit more "dynamic".
CODE $randMsg = array("Hi, welcome to my page!", "Hey you! Thanks for visiting!", "Bonjour, mon ami!", "So, do you like the site?", "Come one, come all!");
$MsgNum = count($randMsg); $MsgGenNum = floor(rand(MsgNum));
echo $randMsg[$msgGenNum];
You can edit those values in the array if you want. Add more if you so choose. Enjoy! |
Reply
rejected
Feb 24 2005, 03:34 AM
Very nice, could you set it to be code snippets? Like CODE $randMsg = array("<img src='1.gif'>", "<img src='2.gif'>", "<img src='3.gif'>", "<img src='4.gif'>", "<img src='5.gif'>");
$MsgNum = count($randMsg); $MsgGenNum = floor(rand(MsgNum));
echo $randMsg[$msgGenNum];
Reply
karlo
Feb 24 2005, 11:31 AM
Before, I readed the PHP manual. And I didn't see the floor function. What's the floor function?
Reply
no9t9
Feb 24 2005, 03:36 PM
@ rejected yes, you can put random html code in there as well. that is how some people do random advertisment and banner rotation. @karlo i believe the floor function is simple to drop any decimals because he is using that number as an index for an array. (an array can't have decimal index number)
Reply
ill
Feb 24 2005, 05:07 PM
It could also be used to display Random Quotes, which is something a lot of E/N sites do!
Reply
Recent Queries:--
php mysql random phrase generator - 6.70 hr back. (1)
-
php random phrase generator - 6.78 hr back. (1)
-
random message generator - 21.01 hr back. (1)
-
random image generator - 22.48 hr back. (1)
-
random message - 42.66 hr back. (1)
-
coded message generator - 58.37 hr back. (1)
-
random messages - 60.61 hr back. (1)
-
display a random message - 63.50 hr back. (1)
-
script random message email - 68.93 hr back. (1)
-
html random message - 69.38 hr back. (1)
-
randomly display a message - 82.41 hr back. (1)
-
generate random text image sig - 99.82 hr back. (1)
-
php random messages - 130.85 hr back. (1)
-
how to make a coded message generator - 139.14 hr back. (1)
Similar Topics
Keywords : random message generator- Imap Problem
- i want to check if the message is not seen (1)
i'd like to know which message i had not been seen, so i searched the manual and fid 2 flags
says Unseen == 'U' || Recent == 'N' mean. but i don,t understand what does Unseen ==
'U' || Recent == 'N' mean(what he mean by flags )? i want to check if the
message is not seen, so how to do that? i tried CODE $inbox =
@imap_open("{mail.mysite.com:110/pop3}",
"".$_SESSION['SESSION_USER_NAME']."+".$_SESSION['S
ESSION_MAIL_HOST']."", $_SESSION&...
Just About Completed My Own Message Board Source.
- This one looks nice! (10)
I've finally completed my message board source code! This one is very nice, and it has
many, many features. So if you can, please rate them and possibly register if you like this
/wink.gif' border='0' style='vertical-align:middle' alt='wink.gif' /> http://subzer0.net/boards/ ...
Dynamic Image / Signature Generator
- a simple code to change text on an image (12)
In search of dynamically changing quote, saying or all other types of text on an image I came across
a code that I have modified to fit my initial usage. This procedure requires two files and short
knowledge of PHP. If you are familiar with Trap17's sig rotation code you will understand this
procedure very fast. Code 1: dynamic_sig.php (you can rename this to index.php and you'll see
at the end why) Code 2: a simple text file named anything (I will call it name.txt ) Code 1
CODE <?php header("Content-type: image/png"); ...
How To Make A Random 7 Number Code?
- (2)
Form Generator
- (9)
I am making a form generator like the one trap17 uses to make the code for website requests. well i
have everything set up, i studied the code from the trap17 generator and learned from it, then i
tried to make my own, but when i click the generate button, the code isnt filled out. if you would
like an example please visit my website at www.notapplicable.rifehost.com/forms/wrf.php the
problem is that it doesnt fill in the the answers. can anyone help? i will put credits on the
affilates page and on the gen pages. Here is my code: (this is the form) Website ...
Forms, Text Files, And Php For A Signature Generator.
- Help a little. (1)
Hello everyone! I am in need of some code a for a signature generator I am making. I am using
BuffaloHELP's code for the php file, now I am trying to improve that code by making a form in a
html file that will have the user say what is on the sig! But now, I need help getting the form
data that is posted by the user to get into that sig! There is a file, sig.txt, where that tells
the php file what text will go on the sig. But how can I make the form data in the html file go into
the text file so it will go onto the sig? You might want to read BuffaloHELP&...
Display Random File In A Directory
- how to display a random file from a set directory. (9)
hi, could someone please help me with this? I have some files in a directory and i want to know how
i can randomly display link/s to one or more of the files in my directory for download. But it must
not at any time display index.php which is also in the directory with the downloads. Thanks in
advance for any help given /unsure.gif" style="vertical-align:middle" emoid=":unsure:" border="0"
alt="unsure.gif" />...
Write Random Text To Image
- PHP script help! (5)
I'm trying to create a script that writes text to an image. CODE
header("Content-type: image/png"); $_phrases = array( "Test 1",
"Test 2", "Test 3", "Test 4", "etc." ); $_rand_phrase =
$_phrases[rand(0,count($_phrases)-1)]; $_image =
imagecreatefrompng("gmail.png"); $_user_width =
imaagettfbbox(9,0,"tahoma.ttf",$_rand_phrase); $_x_value =
(200-($user_width[2] + 113)); ...
My Self-coded Message Boards
- Rate them! (25)
Alright, I used my great knowledge of PHP ( /tongue.gif' border='0' style='vertical-align:middle'
alt='tongue.gif' /> ) to code my own message boards! http://subzer0.net/php . The script
runs exceptionally fast and posting/leveling up works and most of the admin/mod features work. If
you want to register, then you would be able to explore these features more. If you don't, then
could you just rate them by the look of the index? >_> Please rate them from 1 to 10!...
Generate Random Phrases
- ...from a txt file (4)
I have a question on how to generate random phrases (facts, quotes, etc) which the server will
randomly pick from txt file. Normally, I would use SSI to accomplish this task, but I recently added
a blog (Nucleus) to my site which uses PHP (.php file). So my question is, how can you display
random phrases in which the server will pick from a specified text file? Thanks! I saw a
thread very similar to my problem, but the code supplied by Inspired does not allow the server to
select the phrase from a file. The only reason I want this is because I have over 100 quo...
Php Form -fantastico Form Generator
- Need overview re: How To use & setup (0)
Hey Guys, Can anyone give me a quick overview on how to use the Fantastico FORM generator script in
CPanel. Need to set up several forms for website user input. Specifically, HowTo: 1) compose the
form ; 2)Where to put the form (ie. in which folder etc.); 3) how to link the form to buttons on my
other webpages; 4) output the form contents to e-mail boxes. Looked/searched for info &/or a
tutorial but can't find one. Anybody. Thanks RGPHNX...
Looking for random, message, generator
|
*RANDOM STUFF*
*SIMILAR VIDEOS*
Searching Video's for random, message, generator
*MORE FROM TRAP17.COM*
|
advertisement
|
|