1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Help With a Contact Form - Stupid Error

Discussion in 'PHP' started by macca81625, Aug 3, 2009.

  1. #1
    Ok, I have a contact form

    the website is, http://www.webuynow.co.uk the form on the homepage did work correctly, with no issues at all!

    I have tried to replicate the form on the page, why us, linked from the nav, but now neither is working! Could it be linked with the installation of wordpress??
    my php code is as follows, please look at my website for html code

    <?php
    // Website Contact Form Generator 
    // http://www.tele-pro.co.uk/scripts/contact_form/ 
    // This script is free to use as long as you  
    // retain the credit link  
    
    // get posted data into local variables
    $EmailFrom = "website@webuynow.co.uk";
    $EmailTo = "macca81625@hotmail.com";
    $Subject = "Inquiry";
    $Name = Trim(stripslashes($_POST['Name'])); 
    $Telephone = Trim(stripslashes($_POST['Telephone'])); 
    $Make = Trim(stripslashes($_POST['Make'])); 
    $Model = Trim(stripslashes($_POST['Model'])); 
    $Colour = Trim(stripslashes($_POST['Colour'])); 
    $Registration = Trim(stripslashes($_POST['Registration'])); 
    $Year = Trim(stripslashes($_POST['Year'])); 
    $Mileage = Trim(stripslashes($_POST['Mileage'])); 
    $attn = Trim(stripslashes($_POST['attn']));
    $attn1 = Trim(stripslashes($_POST['attn1']));
    
    
    
    
    
    // prepare email body text
    $Body = "";
    $Body .= "Name: ";
    $Body .= $Name;
    $Body .= "\n";
    $Body .= "Telephone: ";
    $Body .= $Telephone;
    $Body .= "\n";
    $Body .= "Make: ";
    $Body .= $Make;
    $Body .= "\n";
    $Body .= "Model: ";
    $Body .= $Model;
    $Body .= "\n";
    $Body .= "Engine: ";
    $Body .= $Colour;
    $Body .= "\n";
    $Body .= "Registration: ";
    $Body .= $Registration;
    $Body .= "\n";
    $Body .= "Year: ";
    $Body .= $Year;
    $Body .= "\n";
    $Body .= "Mileage: ";
    $Body .= $Mileage;
    $Body .= "\n";
    $Body .= "V5: ";
    $Body .= $attn;
    $Body .= "\n";
    $Body .= "Transmission: ";
    $Body .= $attn1;
    $Body .= "\n";
    
    // send email 
    $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
    
    // redirect to success page 
    if ($success){
      print "<meta http-equiv=\"refresh\" content=\"0;URL=thankyouside.php\">";
    }
    else{
      print "<meta http-equiv=\"refresh\" content=\"0;URL=error.php">";
    }
    ?>
    
    Code (markup):
     
    macca81625, Aug 3, 2009 IP
  2. GreenWithEnvy

    GreenWithEnvy Active Member

    Messages:
    125
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #2
    It would be helpful if you posted the error message you are currently getting
     
    GreenWithEnvy, Aug 3, 2009 IP