فرم تماس با ما

Jim Jim

Well-Known Member
دوستان این یه نمونه فرم "تماس با ما" ست که با css کار شده و خیلی سبک و مناسبه
اما برای اینکه وقتی دکمه ارسال رو می زنیم محتویات به ایمیل ارسال بشه چه قسمتی رو باید تغییر داد؟
سطر اول و دوم رو ببینید، آیا چیزی باید اضافه بشه؟ اگر ممکنه نمونه بذارید
لطفا توضیح بفرمائید

HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>فرم تماس</title>
<style type="text/css"> 
body {
	background: #fff;
	margin: 0 auto;
	padding: 0;
}
.contact {
	width: 400px;
	direction: rtl;
	text-align: right;
	font: normal 11px Tahoma, Geneva, sans-serif;
}
.contact h2 {
	font: bold 11px tahoma;
	padding: 8px 2px;
	border-bottom: 1px solid #CCC;
}
.contact label {
	width: 120px;
	float: right;
	margin: 5px 0 0 0;
}
.contact .form, .contact .form-ltr {
	width: 200px;
	float: right;
	padding: 2px;
	font: normal 11px Tahoma, Geneva, sans-serif;
	margin: 5px 0;
}
.contact .form-ltr {
	direction: ltr;
	text-align: left;
}
.contact .text {
	width: 250px;
	height: 100px;
	overflow: auto;
	font: normal 11px/1.4 Tahoma, Geneva, sans-serif;
}
.contact .btn {
	font: normal 11px Tahoma, Geneva, sans-serif;
	margin: 5px 0;
}
</style>
</head>
<body>
<div align="center">
		<div class="contact">
				<h2>پیام خود را ارسال نمایید</h2>
				<form method="post" action="">
						<label for="name"> نام شما : </label>
						<input type="text" value="" class="form" />
						<br  />
						<label for="Email"> پست الکترونیکی : </label>
						<input type="text" class="form-ltr" value="" />
						<br />
						<label for="subject"> موضوع : </label>
						<input type="text" value="" class="form" />
						<br />
						<label for="text"> متن پیام : </label>
						<textarea class="text"></textarea>
						<br />
						<label>&nbsp;</label>
						<input type="submit" value="ارسال" name="submit" class="btn" />
						<input type="reset" value="دوباره" name="reset" class="btn" />
				</form>
		</div><!--Contact-->
</div><!--Center-->
</body>
</html>
 
آخرین ویرایش:

Jim Jim

Well-Known Member
میشه این رو برای aspx درنظر بگیریم؟
در این صورت اگر ممکنه یه نمونه فایل aspx بذارید

با تشکر
 

phonix54

Member
سلام.یه فایل php لازم دارین که محتویاتش رو براتون قرار میدم.آدرس فایل php رو بین کوتیشن مارک اکشن قرار میدیم .میتونین همین فایل php رو هم ویرایش کنید.به جای ایمیل من ایمیل خوئتون رو بزارین.


کد:
[COLOR=#FF8000]action=[COLOR=#0000FF]""[/COLOR][/COLOR]


کد:
<?php

// ------------- CONFIGURABLE SECTION ------------------------

// $mailto - set to the email address you want the form
// sent to, eg
//$mailto        = "[email protected]" ;

$mailto = '[email protected]' ;

// $subject - set to the Subject line of the email, eg
//$subject    = "Feedback Form" ;

$subject = "formtamas" ;

// the pages to be displayed, eg
//$formurl        = "http://www.example.com/feedback.html" ;
//$errorurl        = "http://www.example.com/error.html" ;
//$thankyouurl    = "http://www.example.com/thankyou.html" ;

$formurl = "feedback.html" ;
$errorurl = "error.html" ;
$thankyouurl = "thankyou.html" ;

$email_is_required = 1;
$name_is_required = 1;
$comments_is_required = 1;
$uself = 1;
$use_envsender = 1;
$use_sendmailfrom = 1;
$use_webmaster_email_for_from = 1;
$use_utf8 = 1;
$my_recaptcha_private_key = '' ;

// -------------------- END OF CONFIGURABLE SECTION ---------------

$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;
$content_type = (!isset( $use_utf8 ) || ($use_utf8 == 0)) ? 'Content-Type: text/plain; charset="iso-8859-1"' : 'Content-Type: text/plain; charset="utf-8"' ;
if (!isset( $use_envsender )) { $use_envsender = 0 ; }
if (isset( $use_sendmailfrom ) && $use_sendmailfrom) {
    ini_set( 'sendmail_from', $mailto );
}
$envsender = "-f$mailto" ;
$fullname = (isset($_POST['fullname']))? $_POST['fullname'] : $_POST['name'] ;
$email = $_POST['email'] ;
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );

if (!isset($_POST['email'])) {
    header( "Location: $formurl" );
    exit ;
}
if (($email_is_required && (empty($email) || !preg_match('/@/', $email))) || ($name_is_required && empty($fullname)) || ($comments_is_required && empty($comments))) {
    header( "Location: $errorurl" );
    exit ;
}
if ( preg_match( "/[\r\n]/", $fullname ) || preg_match( "/[\r\n]/", $email ) ) {
    header( "Location: $errorurl" );
    exit ;
}
if (strlen( $my_recaptcha_private_key )) {
    require_once( 'recaptchalib.php' );
    $resp = recaptcha_check_answer ( $my_recaptcha_private_key, $_SERVER['REMOTE_ADDR'], $_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field'] );
    if (!$resp->is_valid) {
        header( "Location: $errorurl" );
        exit ;
    }
}
if (empty($email)) {
    $email = $mailto ;
}
$fromemail = (!isset( $use_webmaster_email_for_from ) || ($use_webmaster_email_for_from == 0)) ? $email : $mailto ;

if (function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc()) {
    $comments = stripslashes( $comments );
}

$messageproper =
    "This message was sent from:\n" .
    "$http_referrer\n" .
    "------------------------------------------------------------\n" .
    "Name of sender: $fullname\n" .
    "Email of sender: $email\n" .
    "------------------------- COMMENTS -------------------------\n\n" .
    $comments .
    "\n\n------------------------------------------------------------\n" ;

$headers =
    "From: \"$fullname\" <$fromemail>" . $headersep . "Reply-To: \"$fullname\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.15.0" .
    $headersep . 'MIME-Version: 1.0' . $headersep . $content_type ;

if ($use_envsender) {
    mail($mailto, $subject, $messageproper, $headers, $envsender );
}
else {
    mail($mailto, $subject, $messageproper, $headers );
}
header( "Location: $thankyouurl" );
exit ;

?>
 

echessdesign

مدیر انجمن طراحی وب
کاربر گرامی mbolandnazar
اینجا هر کاربری که کمکی از دستش بر بیاید، به دیگر دوستان کمک می کنه.
دیر پاسخ گرفتن به معنی عدم پاسخ دهی نیست. (همانند تایپیک فعلی)
برای پیشرفت انجمن باید به هم کمک کنیم، نه اینکه...

از همکاری شما سپاسگزارم
 

جدیدترین ارسال ها

بالا