|
dZ
|
Oct 30 2009, 10:24 PM
Post #1
|
- Posts:
- 72
- Group:
- Members
- Member
- #110,497
- Joined:
- May 14, 2006
- I'm Browsing With
- Firefox 3
|
Just a code I made for Computer Networking at the CACC. Originally our Madlibz were made as Shell Scripts for Linux, but when we added PHP to our Apache servers, I recoded it into PHP and HTML, because Madlibs are $##*in' awesome! (Just FYI, my webserver is a bit over 3gb at school. =p We have a lot of &#^^ on there - And I mean MINE, not everyone combined)
Preview
Shell Script Version - Code:
-
clear echo "Welcome to my madlib! Shall we get started, $USERNAME?" sleep 5 clear echo "Great, $USERNAME! Let's get the show on the road!" echo "Could you please give me an Adjective, $USERNAME?" read adjective1 clear echo "Hmm. Alright, $USERNAME. How about a verb. It must be in the past tense." read verbpast1 clear echo "That's good. I need a proper noun now, kiddo." read pnoun1 clear echo "I like that one, $USERNAME! How about a noun, now?" read noun1 clear echo "Good work. Another verb? Past tense, please." read verbpast2 clear echo "Nice, nice. I like the way your mind works, $USERNAME. Now, I need another silly verb. Past tense again, if you would." read verbpast3 clear echo "You're a natural! Gimme a number, $USERNAME!" read num1 clear echo "Ehh. I don't like that one as much, sorry $USERNAME. I'm sure the Adjective you're about to give me will be great though!" read adjective2 clear echo "See? I told you that would be a good one, $USERNAME! You're a genious! How about an adverb?" read adverb1 clear echo "Alright then, $USERNAME. Another noun, would be nice." read noun2 clear echo "Good work. Can you give me another number, $USERNAME?" read num2 clear echo "Hey! $num2 is my favorite number! Good pick, $USERNAME!" sleep 4 clear echo "Okay, I need an exclamation from you now. Something you would yell at someone, $USERNAME. Doesn't have to be mean, though!" read exclam1 clear echo "Last one, $USERNAME. I need another noun from you." read noun3 clear echo "Please wait while I read and assimilate the data." sleep 1 echo "." sleep 1 echo "." sleep 1 clear echo "Printing to screen..." sleep 2 clear echo "Last Night was the most $adjective1 night of my life! I $verbpast1 home from $pnoun1 yesterday, and stopped at a $noun1 for a drink. That was when I saw her. She $verbpast2 food and drinks to all the customers. I ordered something so I could talk to her, and get a closer look at her. I $verbpast2 a drink and waited $num1 minutes for it. Finally, she came over with my $adjective2 drink. She was dressed $adverb1, and had the most $noun2 face I had ever seen. I tipped her $num2 dollars, and asked her if she wanted to hand out some time. She replied, \"$exclam1!\", and I met up with her the next day. I picked her up from the $noun3 where I met her." sleep 15 echo "I hope you liked reading your results! It's been fun playing with you. Cioa, $USERNAME!" sleep 3 echo "By the way, $USERNAME, I told you this wasn't a silly madlib! It was an awesome one! ;)" sleep 10
Code mad2.php - Code:
-
<html> <head> <title>Nicholas' PHP Madlib</title> </head> <body bgcolor="#767676"> <form action="res2.php" type="text" method="get"> Enter an Adjective<br> <input type="text" name="adjective1" size="50"><br><br> Enter a Verb, past tense.<br> <input type="text" name="verbpast1" size="50"><br><br> Enter a Proper Noun.<br> <input type="text" name="pnoun1" size="50"><br><br> Enter a Noun, please.<br> <input type="text" name="noun1" size="50"><br><br> Enter another Verb, past tense.<br> <input type="text" name="verbpast2" size="50"><br><br> Please, enter a verb again. Once again, past tense.<br> <input type="text" name="verbpast3" size="50"><br><br> Enter a random number.<br> <input type="text" name="num1" size="50"><br><br> Enter another Adjective.<br> <input type="text" name="adjective2" size="50"><br><br> Enter an Adverb, Please.<br> <input type="text" name="adverb1" size="50"><br><br> Enter another Noun.<br> <input type="text" name="noun2" size="50"><br><br> Please, enter another Number.<br> <input type="text" name="num2" size="50"><br><br> Enter an Exclamation. Something you would yell at someone.<br> <input type="text" name="exclam1" size="50"><br><br> One more thing. Enter a Noun.<br> <input type="text" name="noun3" size="50"><br><br> <input type="submit"></form> </body> </html>
res2.php - Code:
-
<html> <head> <title>PHP Madlib, Results</title> </head> <body bgcolor="#767676"> <BR><BR><br><br><center><font size="5">Last night was the most <?php echo $_GET["adjective1"]; ?> night of my life! I <?php echo $_GET["verbpast1"]; ?> home from <?php echo $_GET["pnoun1"]; ?> yesterday, and stopped at a <?php echo $_GET["noun1"]; ?> for a drink. That was when I saw her. She <?php echo $_GET["verbpast1"]; ?> food and drinks to all the customers. I ordered something so I could talk to her, and get a closer look at her. I <?php echo $_GET["verbpast2"]; ?> a drink and waited <?php echo $_GET["num1"]; ?> minutes for it. Finally, she came over with my <?php echo $_GET["adjective2"]; ?> drink. She was dressed <?php echo $_GET["adverb1"]; ?> , and had the most <?php echo $_GET["noun2"]; ?> face I had ever seen. I tipped her <?php echo $_GET["num2"]; ?> dollars, and asked her if she wanted to hang out some time. She replied, " <?php echo $_GET["exclam1"]; ?> ", and I met up with her the next day. I picked her up from the <?php echo $_GET["noun3"]; ?> where I met her. </font></center></body> </html>
|
|
Das
|
Oct 31 2009, 02:40 AM
Post #2
|
|
dZ
|
Oct 31 2009, 12:43 PM
Post #3
|