Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Array of random quotes.
- $Quotes = array
- (
- "A woman's mind is cleaner than a man's: She changes it more often.",
- "Do not take life too seriously. You will never get out of it alive.",
- "I believe that if life gives you lemons, you should make lemonade... And try to find somebody whose life has given them vodka, and have a party.",
- "If you haven't got anything nice to say about anybody, come sit next to me.",
- "I'm sorry, if you were right, I'd agree with you.",
- "Procrastination is the art of keeping up with yesterday.",
- "Go to Heaven for the climate, Hell for the company.",
- "If two wrongs don't make a right, try three.",
- "Age is something that doesn't matter, unless you are a cheese.",
- "Expert: a man who makes three correct guesses consecutively.",
- "Roses are red, violets are blue, I'm schizophrenic, and so am I.",
- "My life needs editing.",
- "If you're going to do something tonight that you'll be sorry for tomorrow morning, sleep late.",
- "Wine is constant proof that God loves us and loves to see us happy.",
- "They say marriages are made in Heaven. But so is thunder and lightning.",
- "When we talk to God, we're praying. When God talks to us, we're schizophrenic.",
- "Reality continues to ruin my life.",
- "If women ran the world we wouldn't have wars, just intense negotiations every 28 days.",
- "If at first you don't succeed, find out if the loser gets anything.",
- "Everything I like is either illegal, immoral or fattening.",
- "I'm like old wine. They don't bring me out very often - but I'm well preserved.",
- "Anytime you see a turtle up on top of a fence post, you know he had some help.",
- "As a child my family's menu consisted of two choices: take it or leave it.",
- "I'm for whatever gets you through the night.",
- "Lead us not into temptation. Just tell us where it is; we'll find it.",
- "Between two evils, I always pick the one I never tried before.",
- "I distrust camels, and anyone else who can go a week without a drink.",
- "I believe in rules. Sure I do. If there weren't any rules, how could you break them?",
- "Any kid will run any errand for you, if you ask at bedtime.",
- "I cook with wine, sometimes I even add it to the food.",
- "Men are liars. We'll lie about lying if we have to. I'm an algebra liar. I figure two good lies make a positive.",
- "I don't believe in the after life, although I am bringing a change of underwear.",
- "Never fight an inanimate object.",
- "If you live to be one hundred, you've got it made. Very few people die past that age.",
- "Cure for an obsession: get another one.",
- "The next time you have a thought... let it go.",
- "Only the mediocre are always at their best.",
- "If at first you don't succeed... so much for skydiving.",
- "The way my luck is running, if I was a politician I would be honest.",
- "The IRS! They're like the Mafia, they can take anything they want!",
- "I was born in very sorry circumstances. Both of my parents were very sorry.",
- "If you can't tell a spoon from a ladle, then you're fat!",
- "Children are smarter than any of us. Know how I know that? I don't know one child with a full time job and children.",
- "I have had a perfectly wonderful evening, but this wasn't it.",
- "Electricity is really just organized lightning.",
- "If men knew how women pass the time when they are alone, they'd never marry.",
- "Forty for you, sixty for me. And equal partners we will be.",
- "I was sleeping the other night, alone, thanks to the exterminator.",
- "I am certain there is too much certainty in the world.",
- "I never drink water because of the disgusting things that fish do in it.",
- "From there to here, and here to there, funny things are everywhere.",
- "I don't care what the haters and naysayers say. If they make jokes about me, I'll laugh because they'll probably be funny.",
- "Life would be tragic if it weren't funny.",
- "Look up at the stars and not down at your feet. Try to make sense of what you see, and wonder about what makes the universe exist. Be curious.",
- "There is no unique picture of reality.",
- "In my opinion, there is no aspect of reality beyond the reach of the human mind.",
- "People who boast about their I.Q. are losers.",
- "What was God doing before the divine creation?",
- "I'm never any good in the morning. It is only after four in the afternoon that I get going.",
- "I'm not that good looking. That's why 'Gangnam Style' works. If someone handsome uses that phrase it's just awkward. But if someone like me uses it, it's funny.",
- "By the way, I'm funniest when I'm not being funny. I'm better to laugh at than with, pretty much.",
- "I'm never afraid to try something if I think it's funny. And I know I'll regret it if I don't.",
- "It's a funny thing, the less people have to live for, the less nerve they have to risk losing nothing.",
- "It's always funny until someone gets hurt. Then it's just hilarious.",
- "To all the girls out there who think being funny is not sexy, you are wrong!",
- "What other people call dark and despairing, I call funny.",
- "Many comedians have a dark side that lets them take a negative thing and turn it funny.",
- "It's funny the way most people love the dead. Once you are dead, you are made for life.",
- "Cheech and I used to call ourselves musicians; we never called ourselves comedians. We were musicians that were funny.",
- "Almost anything can be funny if said the right way - but it has to be said the right way.",
- "Chaos in the midst of chaos isn't funny, but chaos in the midst of order is.",
- "British politics, as the world knows, is a joke. Yet it's rarely funny.",
- "Experience is a funny thing. You don't always have it when you need it.",
- "I don't say things to be offensive; I say things because they're funny to me. It amuses me.",
- "Children are the most honest critics. They will say 'You're funny', but also 'You're pathetic - go away.'",
- "If I studied all my life, I couldn't think up half the number of funny things passed in one session of congress.",
- "Funny thing is that the poorer people are, the more generous they seem to be.",
- "If you watch kids looking at something on television, even something that's produced for them and is supposed to be funny, what you'll notice is that they don't laugh.",
- "It's hard to be funny when you have to be clean.",
- "Go for it now. The future is promised to no one.",
- "Life is 10% what happens to you and 90% how you react to it.",
- "Good, better, best. Never let it rest. 'Til your good is better and your better is best.",
- "Accept the challenges so that you can feel the exhilaration of victory.",
- "The secret of getting ahead is getting started.",
- "It does not matter how slowly you go as long as you do not stop.",
- "Keep your eyes on the stars, and your feet on the ground.",
- "Aim for the moon. If you miss, you may hit a star.",
- "Problems are not stop signs, they are guidelines.",
- "You have to learn the rules of the game. And then you have to play better than anyone else.",
- "By failing to prepare, you are preparing to fail.",
- "Perseverance is failing 19 times and succeeding the 20th.",
- "Do the difficult things while they are easy and do the great things while they are small. A journey of a thousand miles must begin with a single step.",
- "I'd rather attempt to do something great and fail than to attempt to do nothing and succeed.",
- "When you reach the end of your rope, tie a knot in it and hang on.",
- "Well done is better than well said.",
- "If you're going through hell, keep going.",
- "Even if you fall on your face, you're still moving forward.",
- "A goal is a dream with a deadline.",
- "The harder the conflict, the more glorious the triumph.",
- "You can never quit. Winners never quit, and quitters never win.",
- "If you don't like how things are, change it! You're not a tree.",
- "If you want to conquer fear, don't sit home and think about it. Go out and get busy.",
- "You need to overcome the tug of people against you as you reach for high goals.",
- "I really believe that everyone has a talent, ability, or skill that he can mine to support himself and to succeed in life.",
- "Be gentle to all and stern with yourself.",
- "It's always too early to quit.",
- "It is very important to know who you are. To make decisions. To show who you are.",
- "A somebody was once a nobody who wanted to and did.",
- "The wise does at once what the fool does at last.",
- "You never know what motivates you.",
- "The best preparation for tomorrow is doing your best today.",
- "No matter what people tell you, words and ideas can change the world.",
- "I can't change the direction of the wind, but I can adjust my sails to always reach my destination.",
- "If opportunity doesn't knock, build a door.",
- "No act of kindness, no matter how small, is ever wasted.",
- "There are two ways of spreading light: to be the candle or the mirror that reflects it.",
- "Someone is sitting in the shade today because someone planted a tree a long time ago.",
- "Even if I knew that tomorrow the world would go to pieces, I would still plant my apple tree.",
- "With self-discipline most anything is possible.",
- "The measure of who we are is what we do with what we have.",
- "Don't limit yourself. Many people limit themselves to what they think they can do. You can go as far as your mind lets you. What you believe, remember, you can achieve."
- );
- // Set variable from GET data.
- $GeneralQuery = $_GET["GeneralQuery"];
- // Count the items in the array.
- $QuotesInArray = count($Quotes);
- // Generate a quote array number.
- $QuoteNumber = mt_rand(0, $QuotesInArray - 1);
- // Get the correct quote array number for requests.
- $CorrectQuoteNumber = $QuoteNumber + 1;
- // And the actual quote associated in the array.
- $Quote = $Quotes[$QuoteNumber];
- // Check for numeric input for requesting a specific quote.
- if(is_numeric($_GET["GeneralQuery"]))
- {
- // Input needs to be less than the number of quotes total, greater than or equal to 1.
- // Nested IFs work, using || caused... Problems.
- if($GeneralQuery >= 1)
- {
- if($GeneralQuery <= $QuotesInArray)
- {
- // Get the correct quote number for requests.
- $AskedQuote = $GeneralQuery - 1;
- // Show the requested quote.
- echo 'Here is Quote # ' . $GeneralQuery . ' "' . $Quotes[$AskedQuote] . '"';
- die();
- }
- }
- // Invalid quote range inputted.
- echo 'There is no quote matching ' . $GeneralQuery . '!' . ' Valid quotes are 1-' . $QuotesInArray;
- }
- // Show a random quote.
- else
- {
- echo 'Quote # ' . $CorrectQuoteNumber . ' "' . $Quote . '"';
- }
- ?>
- Example:
- Quote.php?
- or
- Quote.php?GeneralQuery=72
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement