Who Wants Free $$$??

Discussion in 'Websites' started by just-4-teens, Nov 12, 2005.

  1. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #21
    how i do that?
     
    just-4-teens, Nov 28, 2005 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #22
    I use

    
    #!/usr/bin/perl
    
    $database = "/home/virtual/site6/fst/var/www/html/win/database.txt";
    
    # Get the input
    read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
    
    # Split the name-value pairs
    @pairs = split(/&/, $buffer);
    
    foreach $pair (@pairs) {
       ($name, $value) = split(/=/, $pair);
    
       $value =~ tr/+/ /;
       $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
       $FORM{$name} = $value;
    }
    
    if ($database ne '') {
        open (DATABASE,">>$database");
        print DATABASE "$FORM{'E-Mail'}-$FORM{'guess'}\n";
        close(DATABASE);
    }
    
    if ($FORM{'url'} eq 'mailto:' || $FORM{'url'} !~ /^(f|ht)tp:\/\/\w+\.\w+/) { 
       &no_email; 
    } 
    
    sub no_email {
       print "Content-type: text/html\n\n";
    print <<EOM;
    <title>Thanks for entering the contest.</title>
    <BODY bgcolor="ffffff" TEXT="000000" link="red" vlink="blue">
    <H1>Thanks for entering the contest!!</H1></center>
    
    PAGE THAT SHOWS UP AFTER ENTERING!!!
    
    EOM
    }
    
    Code (perl):
    $database is where the text file is.

    print DATABASE "$FORM{'E-Mail'}-$FORM{'guess'}\n";

    is what shows up in the text file.

    At the end you enter the HTML that shows up.
    
    <FORM METHOD=POST ACTION="http://www.public-domain-content.com/cgi-bin/contest.cgi">Your E-Mail address: <INPUT TYPE="TEXT" NAME="E-Mail" SIZE=60,1 MAXLENGTH=60><BR>
    <p>
    <input type=radio name="guess" value="Game Cube">Game Cube
    <input type=radio name="guess" value="Game Boy Advance">Game Boy Advance
    <input type=radio name="guess" value="Nintendo 64">Nintendo 64
    <input type=radio name="guess" value="Nintendo DS">Nintendo DS
    <P>
    <INPUT TYPE="SUBMIT" VALUE="Enter the contest"></FORM>
    
    Code (markup):
    for an example of the form.
     
    Nintendo, Nov 28, 2005 IP
  3. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #23
    ive changed the look & way www.pocketfund.com works and looking for more reviews if possible.

    i have also added a forum where the contest will now take place.
     
    just-4-teens, Jan 5, 2006 IP