Jump to content

Help with 'Contact form'


k_ind

Recommended Posts

Hi All,

 

I am trying to create a contact form. The problem i am facing is with the 'submit' button. I want that when the submit button is pressed then the info of the form should go to my email. Can anyone tell the code for that?

 

Thanks!

Link to comment
Share on other sites

 

Hi K_ind, The approach I would use is below. There are plenty of ways you could expand it but its the basic outline. It shows a form where you can enter your name and it will email the specified email address with the name you entered in the form.

 


<?php
if ($_POST["Submit"]=="Submit") {

// Get form variables
$name=$_POST["frm_name"];

//  mail
mail("email@address.com", "Email Subject", "The name entered in the form was $name", $headers)) {


}
?>
<form action="scriptname.php">
<input type="text" name="frm_name">
<input tye="Submit" name="Submit" value="Submit">
</form>

Link to comment
Share on other sites

Thanks for the replies!

 

I am a just a beginner in this area, so pls dont mind if ask somethings which r basics.

 

My other query is I have wampserver on my desktop. Now how to run my files on it to check whats the output?

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.