PDA

View Full Version : contact form help


javierrebelde
04-02-2009, 10:01 PM
hi there i am new with dreamweaver and because i need a webpage rush i bougth a template but wath happen the template come with contact form but dosent work without contact.php the vendor gave me a contact.php but i need to customize my form and .php and i dont know how works with .php so hellllllpppp.

so this is my code on dreamweaver

</div>
<form action="" method="post" id="form1">
<div class="box1">
<div class="border-top">
<div class="border-right">
<div class="border-bot">
<div class="border-left">
<div class="left-top-corner">
<div class="right-top-corner">
<div class="right-bot-corner">
<div class="left-bot-corner">
<div class="inner">
<div class="title"><img src="images/5page-title4.gif" alt="" /></div>
<div class="box3">
<div class="left-top-corner">
<div class="right-top-corner">
<div class="right-bot-corner">
<div class="left-bot-corner">
<div class="inner">
<div class="form">
<label>Name:</label>
<input type="text" />
</div>
<div class="form">
<label>E-mail:</label>
<input type="text" />
</div>
<div class="form">
<label>Fax:</label>
<input type="text" />
</div>
<div>
<label>Message:</label>
<textarea cols="1" rows="1"></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="wrapper"><a href="#" class="link2" onclick="document.getElementById('form1').reset()"><em><b>Reset</b></em></a><a href="#" class="link2" onclick="document.getElementById('form1').submit()"><em><b>send</b></em></a></div>
</form>




and this is the .php


<?
$subject="from ".$_GET['your_name'];
$headers= "From: ".$_GET['your_email']."\n";
$headers.='Content-type: text/html; charset=iso-8859-1';
mail("Your@email.com", $subject, "
<html>
<head>
<title>Contact letter</title>
</head>
<body>

<br>
".$_GET['message']."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");
?>
<script>
resizeTo(300, 300)
//window.close()
</script>




please help to anyone there

Ricky55
04-03-2009, 12:11 AM
Why have you got 500 divs?

javierrebelde
04-03-2009, 12:39 AM
Why have you got 500 divs?


i don't know like i said i bought the template

coloeagle
04-03-2009, 12:48 AM
Looks like a complicated form, lot of unnecessary stuff.

Take a look of this form script, simple and easy for beginners.
http://green-beast.com/gbcf-v3/

javierrebelde
04-03-2009, 01:07 AM
Looks like a complicated form, lot of unnecessary stuff.

Take a look of this form script, simple and easy for beginners.
http://green-beast.com/gbcf-v3/


well i dont know i am new with dream weaver and i dont have time to figure it out is someone help me or i have to take that off the template

edbr
04-03-2009, 02:01 AM
each form has to be named ie <input type="text" name="your_name"/>

your_name 'your_email message

this name will be passed to you form so add that to ach input firld
next you have your form method as post an php as get
the php iss collecting get values.
i would 1 add a name for each input as above
change method to POST
use Ricky's sugestion
if you use your own
in your php change :

$subject="from ".$_GET['your_name'];
$headers= "From: ".$_GET['your_email']."\n";
$headers.='Content-type: text/html; charset=iso-8859-1';
mail("Your@email.com", $subject, "


to
".$_GET['message']."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");

to
$subject="from ".POST['your_name'];
$headers= "From: ".POST['your_email']."\n";
$headers.='Content-type: text/html; charset=iso-8859-1';
mail("Your@email.com", $subject, "


to
".$_POST['message']."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");