 |
|
| Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more. |
|
 |

08-05-2007, 08:00 AM
|
|
Junior Member
|
|
Join Date: 08-05-07
Posts: 6
|
|
|
HTML contact form
Hello guys!
Just wondering if any one can help me set up my contact form on the template i have just got. when some one fills out the form how do i get the form to send to my email address please?
Here is the HTML code on the contact page:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title></title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" style="height:100%;">
<tr>
<td style="width:100%; height:700px;"><table class="e3">
<tr>
<td class="rez"><table>
<tr><td class="rez1"></td></tr>
<tr><td class="rez2"></td></tr>
<tr><td class="rez3"></td></tr>
</table></td>
<td style="width:766px;"><table style="width:766px;">
<!--top-->
<tr>
<td class="top1"><table>
<tr>
<td class="top2"><a href="index.html">
<img alt="" src="http://www.v7n.com/forums/images/logo.gif" width="200" height="63"></a></td>
<td><table class="top3">
<tr>
<td><a href="index.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image1','','images/m1m.jpg',1)">
<img alt="" src="http://www.v7n.com/forums/images/m1.jpg" name="image1" width="98" height="95"></a></td>
<td><a href="index-1.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image2','','images/m2m.jpg',2)">
<img alt="" src="http://www.v7n.com/forums/images/m2.jpg" name="image2" width="74" height="95"></a></td>
<td><a href="index-2.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image3','','images/m3m.jpg',3)">
<img alt="" src="http://www.v7n.com/forums/images/m3.jpg" name="image3" width="73" height="95"></a></td>
<td><a href="index-3.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image4','','images/m4m.jpg',4)">
<img alt="" src="http://www.v7n.com/forums/images/m4.jpg" name="image4" width="62" height="95"></a></td>
<td>
<img alt="" src="http://www.v7n.com/forums/images/m5m.jpg" width="123" height="95"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<!--content-->
<tr>
<td class="w2"><table class="w1">
<tr>
<td class="w3"><table style="margin:31px 0 35px 63px;">
<tr>
<td style="height:273px;"><table style="height:100%;">
<tr>
<!--left-->
<td width="196"><table width="178">
<tr><td class="h" style="height:31px;">Our Address: </td></tr>
<tr><td>
<img alt="" src="http://www.v7n.com/forums/images/5f1.jpg" style="margin-bottom:12px;" width="178" height="85"></td></tr>
<tr><td>
Conost lestecial uno dela lamoriteeselor dela siumonost de la mosesteo delrrem ipsum dolor sit amet consectetueresent vestibulum molestie lenean nonummy.
<br><br style="line-height:15px;">
9863 - 9867 Mill Road, <br>
Cambridge, MG09 99HT <br>
Tel: +1 989 998 92 90<br>
Fax: +1 989 998 92 90<br>
<br><br style="line-height:8px;">
<a href="#">Read more</a>
</td></tr>
</table></td>
<td class="b_bgr"><table style="width:2px; height:100%;">
<tr><td class="b_bgr1"></td></tr>
</table></td>
<td><img alt="" src="http://www.v7n.com/forums/images/spacer.gif" width="16" height="1"></td>
<!--right-->
<td><table width="428">
<tr><td class="h">Contact Form: </td></tr>
<tr><td>Aenean nonummy hendrerit mauris. Phasellus pusce suscipit variuum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculusulla duice feugiat malesuada odio. </td></tr>
<tr>
<td class="f1"><form id="form" action="" enctype="multipart/form-data" name="form"><table style="margin:16px 0 0 0;">
<tr>
<td width="217"><table width="217">
<tr><td>Your full name:</td></tr>
<tr><td>
<input type="text" size="20"></td></tr>
<tr><td>E-mail address:</td></tr>
<tr><td>
<input type="text" size="20"></td></tr>
<tr><td>Your telephone:</td></tr>
<tr><td>
<input type="text" size="20"></td></tr>
<tr><td>Your fax:</td></tr>
<tr><td>
<input type="text" size="20"></td></tr>
</table></td>
<td><table>
<tr><td>Your message:</td></tr>
<tr><td><textarea cols="2" rows="2"></textarea></td></tr>
<tr><td style="padding:0 0 0 112px;"><a href="#" onclick="document.getElementById('form').reset()"> Reset</a><img alt="" src="http://www.v7n.com/forums/images/spacer.gif" width="28" height="1"><a href="#" onclick="document.getElementById('form').submit()" >Submit</a></td></tr>
</table></td>
</tr>
</table></form></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<!--footer-->
<tr><td class="fot1">Design Bureau © 2007 | <a href="index-5.html">Privacy Policy</a></td></tr>
</table></td>
<td class="rez"><table>
<tr><td class="rez4"></td></tr>
<tr><td class="rez5"></td></tr>
<tr><td class="rez6"></td></tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td class="e3"><table class="e3">
<tr>
<td class="e1"></td>
<td class="e"><table>
<tr><td></td></tr>
</table></td>
<td class="e2"></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
Thanks
awg
View Public Profile
Find all posts by awg
#2 Yesterday, 04:23 PM
thetestingsite
Global Moderator
Join Date: Sep 2006
Location: about an hour outside of Las Vegas, Nevada, USA
Posts: 1,691
Thanks: 8
Thanked 190 Times in 187 Posts
--------------------------------------------------------------------------------
You have one of three options:
set the action attribute in the form to mailto: youremail@domain.com
create a server side script (PHP, ASP, etc) to send to your email address
use a remotely hosted form to mail script.
Options 2 and 3 are your best bets becuase they don't require the user to send the email from their email client (and this is very unreliable). If you use the second option, look around these forums or Google for a form mail script. The last option is the same as the second; however, instead of you hosting the script on your server, it is hosted on someone else's server.
Hope this helps.
__________________
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheTestingSite.net
thetestingsite
View Public Profile
Send a private message to thetestingsite
Visit thetestingsite's homepage!
Find all posts by thetestingsite
#3 Yesterday, 04:40 PM
awg
New Coder Join Date: Aug 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Contact PhP file
--------------------------------------------------------------------------------
Hi thanks for your quick reply Is this file what you mean: Contact PhP file?
inside File:
Code:
<?
Error_Reporting(E_ALL & ~E_NOTICE);
while ($request = current($_REQUEST)) {
if (key($_REQUEST)!='recipient') {
$pre_array=split ("&777&", $request);
$post_vars[key($_REQUEST)][0]=$pre_array[0];
$post_vars[key($_REQUEST)][1]=$pre_array[1];
}
next($_REQUEST);
}
reset($post_vars);
$subject="From ".$post_vars['your_name'][0] ;
$headers= "From: ".$post_vars['your_email'][0] ."\n";
$headers.='Content-type: text/html; charset=iso-8859-1';
$message='';
while ($mess = current($post_vars)) {
if ((key($post_vars)!="i") && (key($post_vars)!="your_email") && (key($post_vars)!="your_name")) {
$message.="<strong>".$mess[1]."</strong> ".$mess[0]."<br>";
}
next($post_vars);
}
mail($_REQUEST['recipient'], $subject, "
<html>
<head>
<title>Contact letter</title>
</head>
<body>
<br>
".$message."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");
?>
<script>
resizeTo(300, 300);
</script>
Can you get that working for me please?
Last edited by chicgeek; 08-10-2007 at 10:42 AM.
Reason: truncated with code boxes.
|

08-06-2007, 01:21 AM
|
|
Junior Member
|
|
Join Date: 08-05-07
Posts: 6
|
|
|
Contact Form
Hmmmmm it seems no one knows lol. On my contact page how do I activate the "submit" button? Or how can i direct the submitted information on the form to my email?
|

08-06-2007, 01:07 PM
|
|
Contributing Member
Latest Blog: None
|
|
Join Date: 06-11-07
Posts: 238
|
|
If you want to make a submit form, put this code on contact.php
Code:
<?php
if (preg_match("/^[a-z0-9-._]+@[a-z0-9-._]+\.[a-z]{2,4}$/i", "_POST['email']) && isset($_REQUEST['message']))
//if "email" is filled out, send email
{
//send email
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;
mail("email@address.com", "Support Info", "Return Address: " . $email . "\n" . "Subject: " . $subject . "\n -------MESSAGE CONTENTS------ \n" . $message, "From: Your Website\'s contact page" );
echo "Thank you for your feedback. Your message has been sent.";
}
else
//if "email" is not filled out, display the form
{
if ($_POST['attempt']) {
$emailerr = (preg_match("/^[a-z0-9-._]+@[a-z0-9-._]+\.[a-z]{2,4}$/i", $_POST['email']) ? "" : " <font color=\"red\"><b>Please enter a valid email</b></font>");
$messageerr = ($_REQUEST['message'] != "" ? "" : " <font color=\"red\"><b>Please enter a valid message</b></font>");
}
echo "Please fill out the fields below completely.";
echo "<form method='post' action='contact.php'><table><tr><td><input type='hidden' name='attempt' value='1' />
*E-mail Address: </td><td><input name='email' type='text' value='".$_REQUEST['email']."' />$emailerr</td></tr><tr>
<td>Help Topic: </td><td><input name='subject' type='text' value='".$_REQUEST['subject']."' /></td></tr><tr>
<td colspan=\"2\">*Message:$messageerr<br />
<textarea name='message' rows='15' cols='40'>".$_REQUEST['message']."</textarea></td></tr>
<tr><td><input type='submit' value='Submit' class='rushprocessingbutton' /></td></tr></table></form>";
}
?>
that's a pretty simple email form
edit: be sure to put this inside the <body> tags of your contact.php page
oh, and, replace email@address with your email address [/duh]
Last edited by Capo64; 08-06-2007 at 01:12 PM.
|

08-07-2007, 03:50 AM
|
|
Junior Member
|
|
Join Date: 08-05-07
Posts: 6
|
|
Contact Form
Hi thanks for replying, but still don`t understand because i have a conact form on my page already in a template i got and i have done the other pages OK and now need to do the conact page and of course i want to keep that contact on the site. How do i activate the "submit" button? where do i direct the submitted information on the form to my email? (Hyperlink) I have this PhP file with the template:
Code:
<?
Error_Reporting(E_ALL & ~E_NOTICE);
while ($request = current($_REQUEST)) {
if (key($_REQUEST)!='recipient') {
$pre_array=split ("&777&", $request);
$post_vars[key($_REQUEST)][0]=$pre_array[0];
$post_vars[key($_REQUEST)][1]=$pre_array[1];
}
next($_REQUEST);
}
reset($post_vars);
$subject="From ".$post_vars['your_name'][0] ;
$headers= "From: ".$post_vars['your_email'][0] ."\n";
$headers.='Content-type: text/html; charset=iso-8859-1';
$message='';
while ($mess = current($post_vars)) {
if ((key($post_vars)!="i") && (key($post_vars)!="your_email") && (key($post_vars)!="your_name")) {
$message.="<strong>".$mess[1]."</strong> ".$mess[0]."<br>";
}
next($post_vars);
}
mail($_REQUEST['recipient'], $subject, "
<html>
<head>
<title>Contact letter</title>
</head>
<body>
<br>
".$message."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");
?>
<script>
resizeTo(300, 300);
</script>
Do i use this and if i do where do i edit it and of course where do i put it? on my server with the contact form page together?(subfolder)? And the "submit" button where do i direct that?
Thanks for your help!!
Last edited by chicgeek; 10-12-2007 at 01:05 AM.
|

08-07-2007, 08:13 AM
|
|
Contributing Member
Latest Blog: None
|
|
Join Date: 06-11-07
Posts: 238
|
|
Ok, well first of all I didn't really look at your original code until now cause it was kinda messy looking, but I just did and none of your textboxes have names.
How is it supposed to email the form without knowing what textbox has what filled in?
Your textboxes should look like this (Example for First Name textbox):
<input type="text" name="firstname" size="20" />
Put names in for each of your text boxes, and then make your form's method="post" action="contact2.php"
Then use the mail function in contact2.php to mail your message. Your variables are going to be $_POST['the name of each textbox']
So if you have a textbox: <input type="text" name="firstname" size="20" />
Then the variable on the next page will be $_POST['firstname']
So in the php code you should get all of the $_POST[] variables and string them together and then mail the whole string using the mail function.
Code:
mail ($email, $subject, $message, "From: Contact Form");
where $email is whatever Your email address is (the one you want to receive the email when someone completes the form)
$subject is the subject of the message (doesn't really matter, I'd just make it Contact form submitted or osmething)
and $message is a variable that contains all of the $_POST[] variables that i was talking about before.
I don't really know how else to explain it to you without doing it for you, and what's the fun in that.
If you do all that you don't need to put in the PHP code that the other guy gave you, it's pretty similar
Edit:
I'll give you a little booster to show you what to do with your PHP.
Once you make your <form method="post" action="contact2.php">, and give all your textboxes their names,
make a file called contact2.php in the same directory as the page with your form
on that page put this code in:
Code:
<html>
<head>
<title>Testing</title>
</head>
<body>
<?php
print_r($_POST);
?>
</body>
</html>
At first it's going to look like a lot of gibberish, but if you look at it you'll be able to see each post variable and what it equals
Last edited by Capo64; 08-07-2007 at 08:19 AM.
|

08-09-2007, 08:27 AM
|
|
Junior Member
|
|
Join Date: 08-05-07
Posts: 6
|
|
|
Contact Form
Thank you Capo64 for doing my contact form, it works OK so thanks bud! Your one of the good guys!!
|

08-10-2007, 10:42 AM
|
 |
Contributing Member
|
|
Join Date: 08-19-04
Location: Canadian on the left coast
Posts: 14,199
|
|
|
For the future, code boxes are your friend.
|

10-09-2007, 06:30 AM
|
|
Junior Member
|
|
Join Date: 08-05-07
Posts: 6
|
|
|
Rob send me you email from my site buddy
|

10-09-2007, 06:30 AM
|
|
Junior Member
|
|
Join Date: 08-05-07
Posts: 6
|
|
|
Cannot send any PM messages
|

06-23-2008, 06:27 PM
|
|
Junior Member
|
|
Join Date: 06-23-08
Posts: 2
|
|
|
HTML Contact Form
I am having a similar problem with a template I have. I don't want to use php code I just want to get the code I have to work. I have not worked with a contact form before so it's new to me. When I was reading your comment about the names I got lost. Please help...
Here is the code I have.
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link href="style_location.css" rel="stylesheet" type="text/css" />
<link href="layout.css" rel="stylesheet" type="text/css" />
<script src="maxheight.js" type="text/javascript"></script>
</head>
<body id="page6" onload="new ElementMaxHeight();">
<div id="site_center">
<div id="main">
<!-- header -->
<div id="header">
<div class="row_1">
<div class="fleft">
<h1 class="logo">Business.Co the best customer approach</h1>
</div>
<div class="fright">
<a href="index.html"><img alt="" src="images/header_link1.gif" /></a><a href="#"><img alt="" src="images/header_link2.gif" /></a><a href="#"><img alt="" src="images/header_link3.gif" /></a>
</div>
<div class="clear"></div>
</div>
<div class="row_2">
<div class="block1">
<div class="left">
<div class="right">
<ul class="main_menu">
<li><a href="index.html">Home</a></li>
<li><a href="index-2.html">Products</a></li>
<li><a href="index-3.html">Affiliates</a></li>
<li><a href="index-4.html">Services</a></li>
<li class="last"><a class="current" href="index-5.html">Contacts</a></li>
</ul>
<div class="clear"></div>
</div>
</div>
</div>
</div>
</div>
<!-- content -->
<div id="content">
<div class="row_1">
<div class="bg">
<div class="main_bgd"><iframe width="750" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=d&hl=en&geocode=&saddr=&daddr=30.39544,-86.478581&mra=mi&mrsp=0&sz=17&sll=30.39544,-86.478549&sspn=0.006793,0.01369&ie=UTF8&t=h&s=AARTsJp8UZXrqKy5MfcqGRJTzKlmd3RAQA&ll=30.397679,-86.478539&spn=0.012956,0.032187&z=15&iwloc=ddw1&output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=d&hl=en&geocode=&saddr=&daddr=30.39544,-86.478581&mra=mi&mrsp=0&sz=17&sll=30.39544,-86.478549&sspn=0.006793,0.01369&ie=UTF8&t=h&ll=30.397679,-86.478539&spn=0.012956,0.032187&z=15&iwloc=ddw1&source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small>
<div class="indent">
<h1 style="margin-bottom:22px;">
<p class="txt1" style="margin-bottom:0"></p>
</div>
</div>
</div>
</div>
<div class="row_2 container">
<div class="col_1 block2 maxheight">
<div class="indent maxheight">
<h1><strong>Contact</strong> Form</h1>
<p class="p1"><strong>Need emergency service?<br /><br />
Fill out the form below, and an CCR representative will<br />
call you immediately.</strong></p>
<form id="form2" action="" enctype="multipart/form-data">
<div class="container">
<div class="column1">
Your name:
<div class="form"><input type="text" value="" /></div>
E-mail address:
<div class="form"><input name="text" type="text" value="" /></div>
Address:
<div class="form"><input name="text" type="text" value="" /></div>
Address2:
<div class="form"><input name="text" type="text" value="" /></div>
City:
<div class="form"><input name="text" type="text" value="" /></div>
Zip Code:
<div class="form"><input name="text" type="text" value="" /></div>
Phone:
<div class="form"><input name="text" type="text" value="" /></div>
</div>
<div class="column2">
Your message:
<div><textarea name="textarea" cols="20" rows="20"></textarea></div>
</div>
<div class="clear"></div>
</div>
<div class="alignright" style="margin-right:7px; padding-bottom:10px;"><a href="#" onclick="document.getElementById('form2').reset()">Clear</a> <a href="" onclick="document.getElementById('form2').submit()">Submit</a></div>
</form>
</div>
</div>
<div class="col_2 block3 maxheight">
<div class="indent maxheight">
<h1><strong>Primary</strong> Contacts</h1>
<img alt="" src="images/6_p1.jpg" />
<p class="p1">P.O Box 305<br />
Destin, Fl 32540</p>
Telephone: + 1 877 545 MOLD (6653)<br /><br />
FAX: + 1 850 650 4443<br />
E-mail: <a href="#">support@certified-cleaning.com</a>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<!-- footer -->
<div id="footer">
<div class="indent">
<div class="fleft">
Certified Cleaning & Restoration ©2008 • <a href="index-6.html">Privacy Policy</a>
</div>
<div class="fright">
<a class="rss" href="#">RSS</a>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
</body>
</html>
|

06-23-2008, 06:30 PM
|
|
Contributing Member
Latest Blog: None
|
|
Join Date: 06-11-07
Posts: 238
|
|
|
I think you have to use either cgi-bin or some script (PHP or ASP),
but I'm not positive on that.
|

06-23-2008, 06:51 PM
|
|
Junior Member
|
|
Join Date: 06-23-08
Posts: 2
|
|
Isn't the script in the code? Just not working?
Code:
<form id="form2" action="" enctype="multipart/form-data">
<div class="container">
<div class="column1">
Your name:
<div class="form"><input type="text" value="" /></div>
E-mail address:
<div class="form"><input name="text" type="text" value="" /></div>
Address:
<div class="form"><input name="text" type="text" value="" /></div>
Address2:
<div class="form"><input name="text" type="text" value="" /></div>
City:
<div class="form"><input name="text" type="text" value="" /></div>
Zip Code:
<div class="form"><input name="text" type="text" value="" /></div>
Phone:
<div class="form"><input name="text" type="text" value="" /></div>
</div>
<div class="column2">
Your message:
<div><textarea name="textarea" cols="20" rows="20"></textarea></div>
</div>
<div class="clear"></div>
</div>
<div class="alignright" style="margin-right:7px; padding-bottom:10px;"><a href="#" onclick="document.getElementById('form2').reset()">Clear</a> <a href="" onclick="document.getElementById('form2').submit()">Submit</a></div>
</form>
This being the code at the end:
<a href="#" onclick="document.getElementById('form2').reset()" >Clear</a> <a href="" onclick="document.getElementById('form2').submit() ">Submit</a>
Last edited by endover; 06-23-2008 at 06:57 PM.
|

07-30-2008, 12:30 AM
|
|
Junior Member
|
|
Join Date: 07-30-08
Location: Sudan
Posts: 2
|
|
|
I had the same Problem with the same original code
Sir,
I had the same problem with a code of Contact Form Template, it show me message sent successfully, but no email arrived to the email configured.
in the Thread u said it is working can u tell me how did u solve the problem, i read all the thread and i didn't find any modification in the code.
|

07-30-2008, 02:01 AM
|
 |
Contributing Member
Latest Blog: None
|
|
Join Date: 09-03-07
Location: England
Posts: 649
|
|
Quote:
Originally Posted by endover
Isn't the script in the code? Just not working?
Code:
<form id="form2" action="" enctype="multipart/form-data">
<div class="container">
<div class="column1">
Your name:
<div class="form"><input type="text" value="" /></div>
E-mail address:
<div class="form"><input name="text" type="text" value="" /></div>
Address:
<div class="form"><input name="text" type="text" value="" /></div>
Address2:
<div class="form"><input name="text" type="text" value="" /></div>
City:
<div class="form"><input name="text" type="text" value="" /></div>
Zip Code:
<div class="form"><input name="text" type="text" value="" /></div>
Phone:
<div class="form"><input name="text" type="text" value="" /></div>
</div>
<div class="column2">
Your message:
<div><textarea name="textarea" cols="20" rows="20"></textarea></div>
</div>
<div class="clear"></div>
</div>
<div class="alignright" style="margin-right:7px; padding-bottom:10px;"><a href="#" onclick="document.getElementById('form2').reset()">Clear</a> <a href="" onclick="document.getElementById('form2').submit()">Submit</a></div>
</form>
This being the code at the end:
<a href="#" onclick="document.getElementById('form2').reset()" >Clear</a> <a href="" onclick="document.getElementById('form2').submit() ">Submit</a>
|
You are not submitting the information to anywhere so the mail is never going to be sent.
The above means you're posting form data to no where! It needs to go to a server.
The only real way to do this is use a server to communicate with an smtp server (Simple Mail Transfer Protocol Server). You can, use just any old HTML form but it must send information to a script on a server, which will then send the email via SMTP.
You should research this, I would recommend using a script if you have no experience with coding, but you still need to implement the smtp variables.
HTH's
Boog's
__________________
Price is what you pay... Value is what you get.
Last edited by Boogle; 07-30-2008 at 02:05 AM.
|

07-30-2008, 02:12 AM
|
|
Junior Member
|
|
Join Date: 07-30-08
Location: Sudan
Posts: 2
|
|
|
it is working in another hosting server
the code:
<?
Error_Reporting(E_ALL & ~E_NOTICE);
while ($request = current($_REQUEST)) {
if (key($_REQUEST)!='recipient') {
$pre_array=split ("&777&", $request);
$post_vars[key($_REQUEST)][0]=$pre_array[0];
$post_vars[key($_REQUEST)][1]=$pre_array[1];
}
next($_REQUEST);
}
reset($post_vars);
$subject="From ".$post_vars['your_name'][0] ;
$headers= "From: ".$post_vars['your_email'][0] ."\n";
$headers.='Content-type: text/html; charset=iso-8859-1';
$message='';
while ($mess = current($post_vars)) {
if ((key($post_vars)!="i") && (key($post_vars)!="your_email") && (key($post_vars)!="your_name")) {
$message.="<strong>".$mess[1]."</strong> ".$mess[0]."<br>";
}
next($post_vars);
}
mail($_REQUEST['recipient'], $subject, "
<html>
<head>
<title>Contact letter</title>
</head>
<body>
<br>
".$message."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");
?>
<script>
resizeTo(300, 300);
</script>
it is working in another hosting server properly without any changes, but i face this problem in another hosting server, i doubt the problem with the server.
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 06:54 PM.
Powered by vBulletin Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP
|
|
|