Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: alert message

  1. #1
    New Coder
    Join Date
    Aug 2002
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    alert message

    Hi,

    if i have a form page and this form page(written in perl) allows user to key in a userid. How do i check if the userid already exists in the database. And if it exists, how do i use a alert box to display the error message:"UserID already exists"

    Pls help asap.....

  • #2
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    #!/usr/bin/perl


    print "Content-type: text/html\n\n";


    #READS THE INDATA
    read(STDIN,$indata,$ENV{'CONTENT_LENGTH'});
    @indata = split(/&/,$indata);
    foreach $i (0..$#indata)
    {$indata[$i] =~ s/\+/ /g;
    ($key,$val) = split(/=/,$indata[$i],2);
    $key =~ s/%(..)/pack("c",hex($1))/ge;
    $val =~ s/%(..)/pack("c",hex($1))/ge;
    $indata{$key} .= "\0" if (defined($indata{$key}));
    $indata{$key} .= $val;
    }


    if (-e "$indata{'userid'}.txt")
    {

    print("Userid Already Exisits.\n");
    exit;
    }


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •