1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I Need A Bit of Help with a PERL Script

Discussion in 'PHP & Perl' started by The Scarlet Pimp, Oct 8, 2009.

  1. The Scarlet Pimp

    The Scarlet Pimp Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 2, 2008
    Messages:
    788
    Likes Received:
    3,123
    Occupation:
    Chair moistener.
    Location:
    Cyberspace
    i'm writing an anti-spam routine and i want to know if this is the correct format:

    if($use_nobot_check == "yes" && $color == "") {
    echo "<body bgcolor=#D3D3D3>\n<h1>You did not answer the Anti-Spambot question. Hit your Back button, enter the correct answer and then resubmit the form.</h1>\n</body>\n";
    exit;
    }
     
    Last edited: Oct 9, 2009
  2. dukefx

    dukefx Jr. VIP Jr. VIP Premium Member

    Joined:
    Mar 8, 2009
    Messages:
    246
    Likes Received:
    109
    Occupation:
    VP Information Technology
    Location:
    Dagobah
    firstly, this is php code and not perl.

    secondly it will do this:

    if they did not answer the correct color, it will tell them to go back and answer it.
     
  3. The Scarlet Pimp

    The Scarlet Pimp Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 2, 2008
    Messages:
    788
    Likes Received:
    3,123
    Occupation:
    Chair moistener.
    Location:
    Cyberspace
    1. yes, you are correct. it's php and not perl! :eek:

    2. i know what it does, i want to know if i wrote it correctly. :confused:

    for example, what is the difference between these (if any):

    echo ("You answered the Anti-Spambot question incorrectly");
    echo "You answered the Anti-Spambot question incorrectly";

    they seem to work the same, and i've seen both formats used in scripts... :confused:
     
    Last edited: Oct 10, 2009
  4. The Scarlet Pimp

    The Scarlet Pimp Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 2, 2008
    Messages:
    788
    Likes Received:
    3,123
    Occupation:
    Chair moistener.
    Location:
    Cyberspace
    i got it! :D
     
  5. dukefx

    dukefx Jr. VIP Jr. VIP Premium Member

    Joined:
    Mar 8, 2009
    Messages:
    246
    Likes Received:
    109
    Occupation:
    VP Information Technology
    Location:
    Dagobah
    :cow_yellogreat