Home   News  Product reviews  Website reviews  Forums   Competitions  Subscribe 


Web Building >> Web design & build

 |  Print Thread
emailuser
regular


Reg'd: Wed
Posts: 190
Re: Code for mailto form
      Wed Sep 27 2006 03:06 PM

If your using fasthosts then you will have php and in that case its much better to use php .

The form is in two parts , The first part being the actual entry boxes , The second part being the webpage that sends the entered data to your email address .

$mailhead = "From: andrew@yourdomain.co.uk \n";

$soap="andrew@yourdomain.co.uk";

The only 2 things you need to do is change the above in the second part for the script to work .

You dont need to remove the css or anything else as the browser will just ignore it - the first thing to do is to check the script works ok after changing your email address and uploading both pages to your webspace .





<html>
<head>
<title>form.php</title>
</head>

<body>

<table width="950" border="0" cellspacing="5" cellpadding="0" align="center" class="formfill1">

<form action="form_check.php" method="post" name="duff">

<tr valign="top">
<td align="right" class="form_three">Real Name &nbsp; <img src="images/dod01.jpg" width="20" height="14" border="0" alt=""></td>
<td class="bbb">&nbsp;</td>
<td>
<input type="text" name="ff1" size="70" class="formbox_one">
<span class=kka> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.g. &nbsp; John J Rambo</span>
</td>
</tr>

<tr valign="top">
<td align="right" class="form_three">User Name &nbsp; <img src="images/dod01.jpg" width="20" height="14" border="0" alt=""></td>
<td class="bbb">&nbsp;</td>
<td>
<input type="text" name="ff2" size="70" class="formbox_two">
<span class=kka> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.g. &nbsp; <span class=yya>rambo_2006</span> &nbsp; (2 char min - 20 char max)</span>
</td>
</tr>

<tr valign="top">
<td align="right" class="form_three">Password &nbsp; <img src="images/dod01.jpg" width="20" height="14" border="0" alt=""></td>
<td class="bbb">&nbsp;</td>
<td><input type="text" name="ff3" size="70" class="formbox_three">
</td>
</tr>

<tr valign="top">
<td align="right" class="form_three">Email Address &nbsp; <img src="images/dod01.jpg" width="20" height="14" border="0" alt=""></td>
<td class="bbb">&nbsp;</td>
<td><input type="text" name="ff4" size="70" class="formbox_four"></td>
</tr>

<tr valign="top">
<td align="right" class="form_four">5 DIGIT ANTI SPAM CODE <img src="images/arrow_right.gif" width="11" height="8" border="0" alt=""></td>
<td class="bbb">&nbsp;</td>
<td><input type="text" name="ff5" size="30" class="formbox_five"></td>
</tr>

<tr valign="top">
<td class="bbb">&nbsp;</td>
<td class="bbb">&nbsp;</td>
<td><input type="submit" name="Submit" value="S U B M I T" class="sub_nav_ie"></td>
</tr>

<tr valign="top">
<td align="right" class="kka">e.g.</td>
<td class="bba">&nbsp;</td>
<td align="left" class="kka">after you have signed up you would use something like &nbsp; <span class=yya>www.emailuser.co.uk/?name=rambo_2006</span></td>
</tr>

</form>

</table>

</body>
</html>






<html>
<head>
<title>form_check.php</title>
</head>

<body>

<?php

$subject="EMAIL USER (SIGNUP) " . "(No. $hod[1])";

$mailhead = "From: andrew@yourdomain.co.uk \n";

$mailbody ="USER NAME: " . "$hod[5]" . "\n";
$mailbody .="PASSWORD: " . "$hod[6]" . "\n";
$mailbody .="EMAIL ADDRESS: " . "$hod[8]" . "\n\n";
$mailbody .="Hi " . "$hod[4]" . "\n\n";
$mailbody .="This is your welcome email that contains your validation code" . "\n\n";
$mailbody .="$hod[36]" . "\n\n";
$mailbody .="www.emailuser.co.uk/validate.php" . "\n\n";
$mailbody .="Visit the EU website and enter the validation code shown above to validate your account" . "\n\n";
$mailbody .="Or if your email client allows you can use the following one click url to validate your account" . "\n\n";
$mailbody .="www.emailuser.co.uk/validate_oneclick.php?code=" . "$hod[36]" . "\n\n";
$mailbody .="PLEASE NOTE: passwords cannot be recovered and you are advised to printout this email" . "\n\n";

$body .=stripslashes($mailbody);

$soap="andrew@yourdomain.co.uk";
mail($soap,$subject,$body,$mailhead);

$soap="$hod[8]";
$soap=str_replace(",","",$soap);
$soap=str_replace(" ","",$soap);
$soap=str_replace("\n","",$soap);
$soap=str_replace("\r","",$soap);
$soap=str_replace("\t","",$soap);
$soap=str_replace("%0D","",$soap);
$soap=str_replace("%0A","",$soap);
$soap=str_replace("bcc:","",$soap);
$soap=str_replace("cc:","",$soap);
$soap=str_replace("to:","",$soap);
$soap=str_replace("acc:","",$soap);
mail($soap,$subject,$body,$mailhead);

?>

</BODY>
</HTML>





If everything works as intented and you recieve the email ok - then you can start to edit and change both webpages to suit what ever it is you want it to do .

I will help you with that if needed - but no point going any further until you have checked it works ok .

Post Extras Print Post   Remind Me!     Notify Moderator
Rate this thread

Jump to


Entire topic
Subject Posted by Posted on
* Code for mailto form andrew1971 Wed Sep 27 2006 12:50 PM
. * * Re: Code for mailto form emailuser   Wed Sep 27 2006 01:29 PM
. * * Re: Code for mailto form andrew1971   Wed Sep 27 2006 01:38 PM
. * * Re: Code for mailto form emailuser   Wed Sep 27 2006 02:18 PM
. * * Re: Code for mailto form andrew1971   Wed Sep 27 2006 02:38 PM
. * * Re: Code for mailto form TheFatControlleRAdministrator   Wed Sep 27 2006 03:47 PM
. * * Re: Code for mailto form emailuser   Wed Sep 27 2006 03:06 PM
. * * Re: Code for mailto form andrew1971   Wed Sep 27 2006 04:44 PM
. * * Re: Code for mailto form emailuser   Wed Sep 27 2006 05:49 PM
. * * Re: Code for mailto form emailuser   Wed Sep 27 2006 03:29 PM

Extra information
0 registered and 5 anonymous users are browsing this forum.

Moderator:  putasolutions, Joe_London, greysts, bricat, Nanook, Hello_There, John_McKenna, Mouse, TheFatControlleR 


Print Thread
Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      Mark-up is enabled

Rating:
Thread views: 0

Contact Us | Privacy statement Main website