The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> contact form
deep
post Oct 11 2008, 01:01 AM
Post #1


Advanced Member
****

Group: Members
Posts: 112
Joined: 19-August 08
Member No.: 6,455



hi guys,
can anybody please tellme how to create a contact form. means the form should be emailed to my ymail. here is the form i created and php file(i downloaded).

QUOTE
<!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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<form method="post" action="send detail.php">

<!-- DO NOT change ANY of the php sections -->
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>

<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />


Your Name: <br />
<input type="text" name="visitor" size="35" />
<br />
Your Email:<br />
<input type="text" name="visitormail" size="35" />
<br /> <br />
<br />
Attention:<br />
<select name="attn" size="1">
<option value=" Sales n Billing ">Sales n Billing </option>
<option value=" General Support ">General Support </option>
<option value=" Technical Support ">Technical Support </option>
<option value=" Webmaster ">Webmaster </option>
</select>
<br /><br />
Mail Message:
<br />
<textarea name="notes" rows="4" cols="40"></textarea>
<br />
<input type="submit" value="Send Mail" />
<br />
</form>

<body>
</body>
</html>


php code

QUOTE

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

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sendemail Script</title>
</head>
<body>

<p>
<!-- Reminder: Add the link for the 'next page' (at the bottom) -->
<!-- Reminder: Change 'YourEmail' to Your real email -->

<?php

$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$visitor = $_POST['visitor'];
$visitormail = $_POST['visitormail'];
$notes = $_POST['notes'];
$attn = $_POST['attn'];


if (eregi('http:', $notes)) {
die ("Do NOT try that! ! ");
}
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
echo $badinput;
die ("Go back! ! ");
}

if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>\n";
die ("Use back! ! ");
}

$todayis = date("l, F j, Y, g:i a") ;

$attn = $attn ;
$subject = $attn;

$notes = stripcslashes($notes);

$message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n
From: $visitor ($visitormail)\n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral : $httpref \n
";

$from = "From: $visitormail\r\n";


mail("darli_deep2007@yahoo.com", $subject, $message, $from);

?>
</p>
<p> </p>
<p>Thank you</p>
</body>
</html>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Ghost Designs
post Oct 11 2008, 04:40 PM
Post #2





Group: Members
Posts: 7
Joined: 9-October 08
From: IN
Member No.: 6,849



but like i said i aint good with forms wink.gif
QUOTE
<form method="post" action="send detail.php">



i aint the best with forums, but i believe you need to change the action, make it something like . . .

<form method="post" action="mailto:youremail@yahoo.com">

but like i said i aint very good with forms
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Oct 11 2008, 08:37 PM
Post #3


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



QUOTE(Ghost Designs @ Oct 11 2008, 02:40 PM) *
i aint the best with forums, but i believe you need to change the action, make it something like . . .

<form method="post" action="mailto:youremail@yahoo.com">
No, that won't help. Forms that use action="mailto:..." are unreliable. Submitting to a server-side (e.g., PHP, CGI) program is the right thing to do.

To the original poster:

What happens when you try to submit the form? Do you get any error messages?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
deep
post Oct 11 2008, 11:24 PM
Post #4


Advanced Member
****

Group: Members
Posts: 112
Joined: 19-August 08
Member No.: 6,455



No, the browser is asking for the file download of the php script.

Deep
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Oct 12 2008, 01:27 AM
Post #5


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



That sounds like your server isn't configured to use PHP. Since it doesn't know what *.php files are, it just sends them to the browser as downloadable files.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
deep
post Oct 12 2008, 08:54 PM
Post #6


Advanced Member
****

Group: Members
Posts: 112
Joined: 19-August 08
Member No.: 6,455



so should i configure my dw site. while creating site it will ask "which server technology are you using?" i said iam not using. should i select php there?

Deep
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Oct 12 2008, 10:49 PM
Post #7


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



Does your server support PHP? Is your account configured to use PHP?

There's no point configuring Dreamweaver to use a PHP server if you don't have a PHP server.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
deep
post Oct 13 2008, 04:05 AM
Post #8


Advanced Member
****

Group: Members
Posts: 112
Joined: 19-August 08
Member No.: 6,455



so after uploading the site it will work perfect?

Deep
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Oct 13 2008, 05:06 AM
Post #9


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



Are you trying to run PHP programs without a server? That won't work. Server-side programs require a server.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
deep
post Oct 13 2008, 05:41 AM
Post #10


Advanced Member
****

Group: Members
Posts: 112
Joined: 19-August 08
Member No.: 6,455



oh, ok i will tell you whether it is working or not after uploading the site. but my host server doesn't support php. so you know any host?

Deep
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 05:26 PM