Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Web Programming > PHP Development
User Name
Password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-16-2008, 10:51 AM   #1 (permalink)
carl weathers
Junior Member
 
Join Date: May 2008
Posts: 2
Default Contact Form problems

I have a form on a site I'm working on and I'm running into a small problem. When data is submitted, the email is only returning the first three fields of the form, and everything else is blank. As far as I can tell, my code and html are all correct. I guess they're not, though, since it's not working. Hence me posting this. Code as follows:

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

        $to  =  
"my@email.com";
        $subject = 
"Test";
        
        $name = $_POST
['Name'];
        $company = $_POST
['Company'];
        $address = $_POST
['Address'];
        $contact = $_POST
['Contact'];
        $telephone = $_POST
['Telephone'];
        
        $body  =  
        
"Name: $namen
        Company: $companyn
        Address: $addressn
        Contact: $contactn
        Telephone: $telephone"
;

        mail($to, $subject, $body);

    
} else {

        echo 
"Oops.";
?>

Code:
<form action="form.php" method="post"> <table> <tr> <th><label>Name</label></th> <td><input type="text" name="Name" style="width:300px"/></td> </tr> <tr> <th><label>Company</label></th> <td><input type="text" name="Company" style="width:300px"/></td> </tr> <tr> <th><label>Address</label></th> <td><input type="text" name="Address" style="width:300px"/></td> </tr> <tr> <th><label>Contact</label></th> <td><input type="text" name="Contact" style="width:300px"/></td> </tr> <tr> <th><label>Telephone</label></th> <td><input type="text" name="Telephone" style="width:300px"/></td> </tr> </table> </form>

Like I said, it's only returning the first three items. The email looks like this:

Now, it's only sending the first three fields: Name, Company and Address. Contact and Telephone are included, but are blank. Looks like this:

Name: (whichever name you input)
Company: (company)
Address: (address)
Contact:
Telephone:

Anyone have any ideas?
carl weathers is offline   Reply With Quote
Sponsored Links
Old 05-16-2008, 12:03 PM   #2 (permalink)
carl weathers
Junior Member
 
Join Date: May 2008
Posts: 2
Default Re: Contact Form problems

Ah, nm, got it working. Yay.
carl weathers is offline   Reply With Quote
Old 05-17-2008, 07:21 AM   #3 (permalink)
danielgb123
Junior Member
 
Join Date: May 2008
Posts: 7
Default Re: Contact Form problems



Okay cool, I was about to write what was wrong but seems you worked it out, cool.

danielgb123 is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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

Points Per Thread View: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

» Affiliates
Web Hosting
Marketing Find
Merchant Select
SiteMap Builder
Host Compare
Dedicated Servers

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 08:54 PM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums