Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
problem with php enabled contact form
Old 03-05-2009, 07:09 AM problem with php enabled contact form
Junior Talker

Posts: 1
Name: Bethan
Trades: 0
Hi,

I wonder if anyone could help me. I am fairly new to web development and I am trying to set up a contact form using html and php.

the codes are:
PHP Code:
<form action="sendmail.php" method="post" name="contact form" id="contact form" title="contact form">
              <div id="customer">
                   <h3>Your Details</h3>
                
                        <p>Name : 
                       <input name="Name" type="text" id="Name" accesskey="n" tabindex="1" title="Name" size="33" maxlength="33" />
                        </p>
                         <p>E-mail Address : 
                       <input name="Email" type="text" id="Email" accesskey="e" tabindex="2" title="Email" size="33" maxlength="50" /                >
                           </p>
                     <p>Phone Number : 
                      <input name="Phone" type="text" id="Phone" accesskey="p" tabindex="3" title="Phone" size="33" maxlength="33" />
                       </p>
                </div>
                    
                <div id="vehicle">
                
                     <h3>Vehicle Information</h3>
                    
                  <p>Year : 
                    <input name="Year" type="text" id="Year" accesskey="y" tabindex="4" title="Year" size="33" maxlength="4" />
                  </p>
                  <p>Make : 
                    <input name="Make" type="text" id="Make" accesskey="m" tabindex="5" title="Make" size="33" maxlength="33" />
                  </p>
                  <p>Model : 
                    <input name="Model" type="text" id="Model" accesskey="o" tabindex="6" title="Model" size="33" maxlength="33" />
                    
                                    </p>
         </div>    
                
                <div id="problem">
                
                    Description of Problem : <textarea name="Problem" cols="65" rows="3" id="Problem" accesskey="p" tabindex="6" title="Problem">Please describe the problem here ...</textarea>
         </div>
                <div id="submit">
                    <input name="Reset" type="reset" id="Reset" accesskey="r" tabindex="8" title="Reset" />
                    <input name="Submit" type="submit" id="Submit" accesskey="s" tabindex="7" title="Submit" />
                </div>
      </form>


<?php
if(isset($_POST['submit'])) {

$to "enquiries@bexhillgearboxes.com";
$subject "Message from your website";
$name_field $_POST['Name'];
$email_field $_POST['Email'];
$phone_field $_POST['Phone'];
$year_field $_POST['Year'];
$make_field $_POST['Make'];
$model_field $_POST['Model'];
$problem_field $_POST['Problem'];
 
$body "From: $name_field\n E-Mail: $email_field\n Phone_number:\n $phone_field\n Year: $year_field\n Make: $make_field\n Model: $model_field\n Problem: $problem_field\n";
 
echo 
"Your message has been submitted to $to! we will endeaver to get back to you as soon as possible";
mail($to$subject$body);

} else {

echo 
"Your message has not been sent, please try again or contact us via phone or e-mail!";

}
?>

I have uploaded these files to my server, but when I test the form it always returns the message not sent option.

Is there something obvious I am doing wrong?

Thanks for any help people can offer

Last edited by chrishirst; 03-05-2009 at 07:23 AM..
BethanDavies is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-05-2009, 07:26 AM Re: problem with php enabled contact form
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
"Submit" and "submit" are NOT the same in PHP variables
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to problem with php enabled contact form
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10760 seconds with 12 queries