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.

Guest Register Form

Discussion in 'General Discussion' started by stefanmain, Jul 19, 2010.

  1. stefanmain

    stefanmain Active Member

    Joined:
    May 12, 2010
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    I have recently moved my domain from PlusMail to cPanel. Everything works fine ... except. On the PlusMail format, I had a page which (1) allowed visitors to sign in and (2) then, on Submit, automatically sent an email to me with the data, comments, etc. which visitors left behind, and (3) redirected the visitor to a "Thank You" page . It was not a "guest book" as such, because the data was not accessible by other visitors.

    Here is the code I used at PlusMail:
    Code:
    <form method="POST" action="http://mydomain.com/cgi-bin/formmail.cgi" onSubmit="if (this.email_address.value == this.confirm_email.value) { return true; } else { alert('Email addresses do not match!'); this.confirm_email.focus(); return false; }">
     <input type="hidden" name="recipient" value="webmaster@mydomain.com">
     <input type="hidden" name="subject" value="Guest Register">
     <input type="hidden" name="redirect" value="http://mydomain.com/thanks.html">
     <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT">
     <input type="hidden" name="style" value="1">
     <input type="hidden" name="sort" value="order:realname,url,email_address,confirm_email,country,else,comments">
     <input type="hidden" name="print_config" value="realname,email_address,confirm_email">
     <div align="center">
          <table>
        <tr>
         <td><p class="text0em" align="left">Full Name:</p></td>
         <td><input type="text" name="realname" size="20"></td>
        </tr>
        <tr>
         <td><p class="text0em" align="left">Your URL (if any):</p></td>
         <td><input type="text" name="url" value="http://" size="20"></td>
        </tr>
        <tr>
         <td><p class="text0em" align="left">Email Address:</p></td>
         <td><input type="text" name="email_address" size="20"></td>
        </tr>
        <tr>
         <td><p class="text0em" align="left">Confirm Email Address:</p></td>
         <td><input type="text" name="confirm_email" size="20"></td>
        </tr>
        <tr>
         <td><p class="text0em" align="left">Country:</p></td>
         <td><input type="text" name="country" size="20"></td>
        </tr>
        <tr>
         <td><p class="text0em" align="left">Anything else?:</p></td>
         <td><input type="text" name="else" size="20"></td>
        </tr>
       </table>
      </div>
      <p align="center">Comments, Suggestions, Whatever<br>
       <textarea name="thetext" rows="20" cols="80">
       (Please delete this sentence and replace it with your comments.)
       </textarea>
      </p>
      <p align="center">
       <input type="SUBMIT" value="Send It">
       <input type="RESET" value="Erase It">
       </p>
    </form>
    At cPanel, I found this code for a Guest Book:

    Code:
    <form action="/cgi-sys/guestbook.cgi" target=guestwindow>
    <input type="hidden" name="user" value="mydomain">
    <input type="hidden" name="action" value="addguest">
    <input type="hidden" name="basehref" value="http://mydomain.com">
    <input type="hidden" name="template" value="default">
    Name: <input type="text" name="name"><br>
    Email: <input type="text" name="email"><br>
    Url: <input type="text" name="url"><br>
    Comments: <textarea name="comments"></textarea><br>
    <input type="submit" value="Sign Guestbook">
    </form>
    I tried adapting the cPanel code to the old PlusMail code, but I can't get it to work right (it is over my head).

    My question: Is there a way to make the old PlusMail FORM code work in cPanel? Thank you.
     
    #1 stefanmain, Jul 19, 2010
    Last edited: Jul 19, 2010
  2. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Try adjusting the "action" in the form from using "/cgi-bin/" to using "/cgi-sys/" as seen below:

    Before:
    Code:
    action="/cgi-bin/formmail.cgi"
    After:
    Code:
    action="/cgi-sys/formmail.cgi"
    The above will require the following configuration option to be enabled via WHM:
    WHM: Main >> Server Configuration >> Tweak Settings >> Software >> Enable FormMail-clone CGI
     
  3. stefanmain

    stefanmain Active Member

    Joined:
    May 12, 2010
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Is that something I can do at cPanel, or is that something I need to request from the server provider?
     
  4. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    The configuration option in WHM requires root ("Administrator") access; depending on your situation this might be something to request from the hosting service provider. When enabled you can then use the formmail-clone script within the "cgi-sys" path.

    Do you happen to have the original "formmail.cgi" script from the old hosting service still in your current "cgi-bin" directory?
     
  5. stefanmain

    stefanmain Active Member

    Joined:
    May 12, 2010
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Thanks to your suggestion, I retrieved the original "formmail.cgi" script from the old PlusMail server and FTP'd it to the cgi-bin on the cPanel server (both the PlusMail and cPanel servers belong to the same hosting company).

    So, the page works again!

    Thank you for your help.
     
    #5 stefanmain, Jul 20, 2010
    Last edited: Jul 20, 2010
  6. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Thank you for the status update. I wanted to note that the "cgi-sys" sub-directory is a shared path and it is not usually seen when viewing the files stored in the account (e.g., via cPanel File Manager, FTP, SFTP, SSH, or cPanel WebDisk/WebDAV). You may still try attempting to use the formmail-clone script to see if the host has it enabled and if the formmail-clone script is enabled then the same form should work very similar if not the same as before, the only difference being that the form would be using a script stored in a shared path on the system.

    You may test to see if the formmail-clone script is accessible by visiting your web site using the following URI:
    Code:
    /cgi-sys/formmail.cgi
    Example:
    Code:
    http://www.domain.tld/cgi-sys/formmail.cgi
    If accessed successfully and the formmail-clone script is enabled, you may see a page that shows text similar to the following:
    Code:
    FormMail-Clone Version: 2.4
    This is FormMail-clone, a clone of FormMail.cgi. It is a clean room version for legal purposes (a less restrictive liscense), but should behave the exact same way as Matt Wright's Original, but contain none of his code.
    If accessed successfully but the formmail-clone script is disabled, you may see a page that shows text like the following:
    Code:
    FormMail-Clone
    The system administrator has disabled this script.
     
    #6 cPanelDon, Jul 21, 2010
    Last edited: Jul 21, 2010
Loading...

Share This Page