urgent help for creating contact us page

Hello,

I am a newbie to php, i have created a contact us page in HTML which is named as “form.html” This form has around 10 fields.

When user clicks on submit button all the details should reach at the email address [email protected]
p.s. mpadvisor.com is the domain name of the firm i am currently working with

Can any1 please guide me step by step for the same.
Awaiting response at the earliest.

Thank you in advance. :wink:

Use PHP’s inbuilt mail () function.

mail (string to, string subject, string message)

I hope that what you wanted to know.

Thanks

Hey dear,

Thanx for the help. I did that code in php. Have a check below:

<?php if(isset($_POST['submit'])) { $to = '[email protected]'; // change e-mail adress $send_date = date('d-m-Y H:i:s'); $message = ' Contact

Data trimitere: '.$send_date.'

First Name: '.$_POST['first'].'
Last Name: '.$_POST['last'].'
Company: '.$_POST['cname'].'
Designation: '.$_POST['desi'].'
E-Mail: '.$_POST['email'].'
Add1: '.$_POST['add1'].'
city: '.$_POST['city'].'
state: '.$_POST['state'].'
zipcode: '.$_POST['zip'].'
Country: '.$_POST['country'].'
Phone: '.$_POST['phone'].'
Cell number: '.$_POST['cell_no'].'
Questions: '.$_POST['question'].'
Suggestions:

'.$_POST['suggestions'].'
'; $headere = "MIME-Version: 1.0\r\n"; $headere .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headere .= "From: ".$_POST['first']." ".$_POST['cname']."<".$_POST['email'].">\r\n"; mail($to, $send_date, $message, $headere); echo 'Your details has been submittted to $to!'; } else { echo "blarg! Sorry for the inconvinence!"; } ?>

now when i click submit button it directly gives the else statement in my php code which is “blarg! Sorry for the inconvinence!”

It dosent send me the email. Can you help me further with this ?

Cant understand its happening mate. Sorry for nt able to help you.

Hey,

That’s fine. Thanks for the help till time. I have changed the input form field, so lets c if this works. Anyways take care. Hope 2 b in touch with you

Hrishit Trivedi

I am from India and I think you are as well. Would love to know your email so that I may add you for the chat. Please PM me your email if you don’t mind telling it :slight_smile:

Thanks

I’ve tried it out. And it seems your submit button must be wrong.

Try that.

Also,
echo ‘Your details has been submittted to $to!’;
change to
echo ‘Your details have been submittted to ‘.$to.’!’;

Sponsor our Newsletter | Privacy Policy | Terms of Service