The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Perl Script return empty page

Discussion in 'General Discussion' started by caebiz, Jun 27, 2004.

  1. caebiz

    caebiz Registered

    Joined:
    Jun 26, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Some time, when I use a .pl script, the resulting page is an empty page, with only the basic html tag. head, title, body, etc.

    After 3-4 reloading, I have the right result, a working page.

    What is the problem?

    How to cure?
     
  2. caebiz

    caebiz Registered

    Joined:
    Jun 26, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    this is a part of the code of the script:

    PHP:
    $defuser $FORM{'domain'};
    $defuser =~ s/\.(.*)//g;
    $defuser substr($defuser,0,8);

    $response $whm->createacct("$FORM{'domain'}","$defuser","$FORM{'password'}","$FORM{'plan'}");

    if (
    $response =~ /username is taken/) {
            print 
    "That domain is already setup on this server.   Did you click the submit button twice?\n";
            
    sendmail("failed (domain exists)",$response);
            exit;
    }
    if (
    $response !~ /wwwacct creation finished/) {
            print 
    "There was a problem setting up the account.  Your submission has been sent to the admin for manual processing\n";
            
    sendmail("failed and needs manuall processing (unknown)",$response);
            exit;
    }

    print <<
    EOM;
    <
    h1>Account Signup Complete</h1>
    Thank you for your signup!
    <
    pre>
    <
    b>Domain Name</b>: $FORM{'domain'}
    <
    b>User Name</b>: $defuser
    <b>Password</b>: $FORM{'password'}
    <
    b>cPanel Access Url</b>: [url]http://[/url]$mainip:2082/
    EOM
    sendmail
    ("",$response);
    (it is written in Perl).

    Please help me
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    A small segment really isn't enough, but from that there is a line missing, there should be the following somewhere before any other output is sent:
    Code:
    print "content-type: text/html\n\n";
    What the problem certainly will be, is either with the script, file or directory permissions. It's highly unlikely that the problem will have anything to do with Apache and has nothing to do with cPanel itself (so long as you have enabled CGI for the account).
     
Loading...

Share This Page