Simple Question

Hey everyone,

I just started PHP yesterday and I’ve already got a customer requesting for a simple webform for his website. I’ve built the form in html easily enough, but for some reason when I submit the form, the php doesn’t output any of the variables.

I don’t yet have access to the website, and because I just started I’ve been practicing with XAMPP, but i shouldn’t think that should affect this code. This is what I have:

[code]

Service Request Type: Please select an option... Urgent/Emergency Work Maintenance/General Work Quote Request
Venue/Customer Name:
Contact Name:
Phone Number:
Email Address:
Address/Location of Work:
Details of Work Required:
[/code]

and the PHP:

[php]

<?php $to = "[email protected]"; $work = $_POST["Service_Request"]; $name = "Venue/Customer Name: " . $_POST["name"]; $contact = "Contact Name: " . $_POST["cont"]; $phone = "Phone Number: " . $_POST["phone"]; $email = "Email Address: " . $_POST["email"]; $address = "Address/Location of Work: " . $_POST["addr"]; $details = $_POST["details"]; $message = $name . \n . $contact . \n . $phone . \n . $email . \n . $address . \n . $details; $from = "From:" . $email; // mail($to,$work,$message,$from); // echo "Mail Sent."; echo $name; ?>

[/php]

I can’t figure out why this isn’t sending the value of $name to the screen, at the very least I thought it would output the string part contained in $name, but that doesn’t seen to work either. Help?

Sponsor our Newsletter | Privacy Policy | Terms of Service