Form help using Html and php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nomad
    Recognized Expert Contributor
    • Mar 2007
    • 664

    Form help using Html and php

    Hello everyone.
    I need some help with this it wried
    I create a form which works on one site but not another site.
    one that works

    one that does not work

    I get this error
    Internal Server Error

    The server encountered an internal error or misconfiguratio n and was unable to complete your request.

    Please contact the server administrator, webmaster@redla ndsgottalent.co m.au and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    here is my php code.
    Code:
    <?php
    // get posted data into local variables
    $EmailFrom = "Redlands Got Talent Show 2010";
    $EmailTo = "abc@example.com";
    $Subject = "Redlands Got Talent Show Entry Forum 2010";
    $name = Trim(stripslashes($_POST['name'])); 
    $birthdate = Trim(stripslashes($_POST['birthdate'])); 
    $school = Trim(stripslashes($_POST['school'])); 
    $address = Trim(stripslashes($_POST['address'])); 
    $postcode = Trim(stripslashes($_POST['postcode'])); 
    $email = Trim(stripslashes($_POST['email'])); 
    $telephone = Trim(stripslashes($_POST['telephone'])); 
    $group = Trim(stripslashes($_POST['group']));
    $song = Trim(stripslashes($_POST['song']));
    $dance = Trim(stripslashes($_POST['dance']));
    $Instrumental = Trim(stripslashes($_POST['Instrumental']));
    $description = Trim(stripslashes($_POST['description']));
    $other = Trim(stripslashes($_POST['other']));
    $release = Trim(stripslashes($_POST['release']));
    $payment = Trim(stripslashes($_POST['payment']));
    $credit = Trim(stripslashes($_POST['credit']));
    $namecard = Trim(stripslashes($_POST['namecard']));
    $cardnumber = Trim(stripslashes($_POST['cardnumber']));
    $date = Trim(stripslashes($_POST['date']));
    $tax = Trim(stripslashes($_POST['tax']));
    
    // validation
    $validationOK=true;
    if (!$validationOK) {
      print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
      exit;
    }
    
    // prepare email body text
    $Body = "Name(s): ";
    $Body .= $name;
    $Body .= "\n";
    $Body .= "Date(s) for Birth (in order): ";
    $Body .= $birthdate;
    $Body .= "\n";
    $Body .= "School: ";
    $Body .= $school;
    $Body .= "\n";
    $Body .= "Address: ";
    $Body .= $address;
    $Body .= "\n";
    $Body .= "Postcode: ";
    $Body .= $postcode;
    $Body .= "\n";
    $Body .= "Email: ";
    $Body .= $email;
    $Body .= "\n";
    $Body .= "Telephone: ";
    $Body .= $telephone;
    $Body .= "\n";
    $Body .= "Section your are entering: ";
    $Body .= $group;
    $Body .= "\n";
    $Body .= "Song: ";
    $Body .= $song;
    $Body .= "\n";
    $Body .= "Dance:";
    $Body .= $dance;
    $Body .= "\n";
    $Body .= "Instrumental: ";
    $Body .= $Instrumental;
    $Body .= "\n";
    $Body .= "Description: ";
    $Body .= $description;
    $Body .= "\n";
    $Body .= "Other/Novelty: ";
    $Body .= $other;
    $Body .= "\n";
    $Body .= "I agree to the use of photographs of me/us to be used in event publicity: ";
    $Body .= $release;
    $Body .= "\n";
    $Body .= "Payment type ";
    $Body .= $payment;
    $Body .= "\n";
    $Body .= "Credit Card information";
    $Body .= "Credit Card: "; 
    $Body .= $credit;
    $Body .= "\n";
    $Body .= "Name on Card: "; 
    $Body .= $namecard;
    $Body .= "\n";
    $Body .= "Card Number: "; 
    $Body .= $cardnumber;
    $Body .= "\n";
    $Body .= "Expirt Date: ";
    $Body .= $date;
    $Body .= "\n";
    $Body .= "I require a Tax Receipt: ";
    $Body .= $tax;
    
    // send email 
    $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
    
    
    // redirect to success page 
    if ($success){
      print "<meta http-equiv=\"refresh\" content=\"0;URL=thanks.htm\">";
    }
    else{
      print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
    }
    ?>
    If you need the htm code let me know I figure you can get it by using the source code on the page.

    Many Thanks
    damon
    Last edited by Atli; Feb 19 '10, 02:05 AM. Reason: Replaced real email addresses with example value.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    do you have a .htaccess file on the second server? does this happen with other .php files?

    Comment

    • kovik
      Recognized Expert Top Contributor
      • Jun 2007
      • 1044

      #3
      Your best bet is to look at the server logs. The message that you are getting is a default message used to hide the real error from the client. Your logs should give you a much more clear idea of what is going wrong, be it a problem with .htaccess, or a problem with server extensions.

      Comment

      Working...