Jump to content

Please Help! New to php


asdgq9

Recommended Posts

Hi, I want to post a simple comments box at the bottom of one of my web pages that will send the data from 3 different inputs, named "name," "costumer_mail," and "detail," to my email, but I am new to php. Can someone look at my php code and see what is wrong? I'm having trouble trying to find a spot to put the input "name" in the php.

 

PHP:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

 

<head>

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />

<title>Send Data Form</title>

</head>

 

<body>

<?php

// Contact subject

$subject='Comment Posted From Website';

// Details

$message=$_POST['detail'];

 

// Mail of sender

 

// From

$headers=$_POST['customer_mail'];

 

// Enter your email address

$to ='******my e-mail address*****';

{

mail($to,$subject,$message,$headers);

}

// Check, if message sent to your email

// display message "Thank you for your submission"

if($send_contact){

echo "Thank you for your submission";

}

else {

echo "ERROR, your comment was not sent";

}

 

 

 

HTML form:

 

<form method="post" action="send_contact.php" name="comment_form">

<table cellspacing="0" style="width: 153%" class="style6">

<tr>

<td style="width: 286px; height: 29px;">Name:</td>

 

<td style="height: 29px">

<input name="name" type="text" style="width: 250px; height: 22px"/> </td>

</tr>

<tr>

<td style="width: 286px">E-mail Address/Phone Number:</td>

<td>

<input name="customer_mail" type="text" class="style4"style="width: 250px; height: 22px"  /> </td>

</tr>

<tr>

<td colspan="2" class="style5">

<textarea name="detail" style="width: 582px; height: 157px"></textarea> </td>

</tr>

<tr>

<td colspan="2" class="style7" valign="top">

<input type="submit" name="Submit" style="width: 87px" value="submit" /> </td>

</tr>

</table>

</form>

 

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.