+1-888-365-2779
Try Now
More in this section

Form

2 posts, 0 answered
  1. Fran O'Prey
    Fran O'Prey avatar
    11 posts
    Registered:
    06 Apr 2010
    13 Apr 2010
    Link to this post
    Hi,

    Not sure if you can help me with this but I created a new form on our website which was bulit using Sitefinity. I created the form as a PHP file as I don't have any prior knowledge of ASP.net. I created a second file to with the actions of what I want the form to do i.e. forward onto an email address. All of the code appears to be fine but for some reason I keep getting a "500 Internal Server Error" message.

    The code I am using for the form is:

    <h1>Unsubscribe</h1>
     
    <table width="410" border="0" cellpadding="7">

    <td height="18" valign="top" bgcolor="#FFFFFF" class="style7"><p align="left" class="style7">Please fill out the form below to unsubscribe from our pormotional offers.</p>

    <form method="post" action="sendunsubscribeform.php">

     

    <tr>
                  <td width="120" class="style5"><label for="firstname">First Name:</label></td>
                  <td class="style5"><input type="text" name="firstname" id="firstname" />              </td>
                </tr>

    <tr>
                  <td width="120" class="style5"><label for="lastname">Last Name:</label></td>
                  <td class="style5"><input type="text" name="lastname" id="lastname" />              </td>
                </tr>

    <tr>
                  <td width="120" class="style5"><label for="emailaddress">Email:</label></td>
                  <td class="style5"><input type="text" name="emailaddress" id="emailaddress" />              </td>
                </tr>

    </table>

          <p>
         <input type="submit" name="btnSubmit" id="btnSubmit"
                 value="Submit" class="btn" />
           </p>

    </form> 



    and code within the action file is:

    <?php

    $firstname = $_REQUEST['firstname'];
    $lastname = $_REQUEST['lastname'];
    $emailaddress = $_REQUEST['emailaddress'];

     

    $subject = "Enquiry Form from ".$_POST['emailaddress'];
    $message =  "First Name: ".$_POST['firstname']."\n".
                    "Last Name: ".$_POST['lastname']."\n".
       "Email Address: ".$_POST['emailaddress']."\n";
      
    $success = mail('test@test2.ie', $subject, $message, 'From: Scan Order Form <'">no-reply@sysnetglobalsolutions.com>');         

    header("Location:http://www.sysnetglobalsolutions.com/en/thankyou.aspx");
    exit;

    ?>



    Any help is much appreciated!

    Thanks
  2. Fran O'Prey
    Fran O'Prey avatar
    11 posts
    Registered:
    06 Apr 2010
    13 Apr 2010
    Link to this post
    Just checked the form on my own website and it functions fine. When I use forms on my own website, I don't use a CMS and I keep the file that holds the form and the action file within the same directory. However, when I insert the two of these files within the www.root/ folder on the server, the 500 internal server error keeps coming up after I click on the submit button...................any ideas? Maybe I am storing the action file in the wrong place?
2 posts, 0 answered