GFXVoid Graphic Design Forum

Remove Text Formatting
Loading...

» Online Users: 13,965

0 members and 13,965 guests
No Members online

» Site Navigation

 > FAQ

» Stats

Members: 35,442
Threads: 103,075
Posts: 826,688
Top Poster: cc.RadillacVIII (7,429)
Welcome to our newest member, Lekelindids
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2004
    Location
    Buffalo Grove, Illinois
    Posts
    350

    Default

    Use the following tutorial to display random qutoes on whatever site you would like!

    Code
    Code:
    #!/usr/bin/perl -wT
    
    #Setup Module Use
    use CGI qw(:standard);
    use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
    use strict;
    
    #Quotes Are Placed Here. Seperate by comma
    my @quotes = ("Don't die today!",
    "Why don't you fly",
    "What's up?");
    
    #Prints the Actual Quotes
    print header;
    my $quote = $quotes[int(rand($#quotes+1))];
    print qq(<b>$quote</b>\n);
    Notes
    - This file must be chmodded to 0755 or higher.
    - This file must be located in the "CGI-BIN".

    Example Here

  2. #2
    Join Date
    Jun 2005
    Posts
    2

    Default

    I swear I'm not trying to be a jerk.

    Originally posted by demo@Mar 3 2005, 12:18 AM
    Code:
    use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
    That's a bad idea for a production CGI (one that you're not just testing). Showing errors to the outside can give hackers a lot of information about a script and a server. Make sure to take that line out for the real deal.

    Here is a link to another random quote CGI in perl that's super simple to code (4 lines) and even easier to manage (plain text quotes, no code): http://sedition.com/perl/random-quote-cgi.html

Similar Threads

  1. Replies: 14
    Last Post: 04-27-2006, 07:27 AM
  2. Random Quotes
    By masokist in forum The Void
    Replies: 12
    Last Post: 01-23-2005, 12:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBadvanced CMPS v4.1.1