hello,
i want to do small mail concept. what it zzzzz means admin sends registration form to user mails. in that mail user can register their account . my doubt is is there any chance to apply validations in mail. below is my script.
<?
ob_start();
extract($_REQUEST);
include("includes/class.phpmailer.php");
if($_POST)
{
/////////////////////////////////////////////////////////////////////////////////////////////
/////// send registrationform to user /////////
///////////////////////////////////////////////////////////////////////////////////////////
$sitename="http://localhost/murali/";
//this subject will be visible only for you
$sub = "".$name." invites you to www.murali.com";
$msg = "<html><head>
<script>
function valide()
{
if(document.formz.username.value=='')
{
alert('enter username');
document.formz.username.focus();
return false;
}
if(document.formz.password.value=='')
{
alert('enter password');
document.formz.password.focus();
return false;
}
else
{
window.document.formz.action='http://localhost/murali/';
}
}
</script>
</head>
<body>
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td height='8'></td>
</tr>
<tr>
<td style='font-family:Verdana; font-size:12px; font-weight:normal; color:#000000' align='left'>
<br>
<p>".$transl2." </p><br>
<form name='formz' action='' method='post' onsubmit='return valide();'>
<table align='center'>
<tr>
<td>username</td>
<td><input type='text' name='username'></td>
</tr>
<tr>
<td>password</td>
<td><input type='password' name='password'></td>
</tr>
<tr>
<td>Address</td>
<td><input type='address' name='address'></td>
</tr>
<tr>
<td> </td>
<td><input type='submit' name='submit' value='submit' ></td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td height='8'></td>
</tr>
<tr>
<td height='8'></td>
</tr>
<tr>
<td height='8'></td>
</tr>
<tr>
<td align='left' style='font-family:Verdana; font-size:12px; font-weight:bold; color:#47493F'>Regards,<br>
murali.
</td>
</tr>
<tr>
<td height='8'></td>
</tr>
<tr>
<td height='8'></td>
</tr>
<tr>
<td height='4'></td>
</tr>
</table></body>
</html>";
$msg = stripslashes($msg);
//include("includes/class.smtp.php");
//include("includes/constants.php");
$SmtpAuth = 1; // 1 For IsSMTP() and 0 For IsMail()
$mail = new PHPMailer();
//$mail->IsMail();
if($SmtpAuth == 0)
{
$mail->IsMail();
}
else
{
$mail->IsSMTP();
$mail->Host = "xxxx"; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "xxxx"; // SMTP username
$mail->Password = "xxxx"; // SMTP password
} // set mailer to use SMTP
$mail->From = $_POST[email];
$mail->FromName = $_POST[name];
$mail->AddAddress($_POST[useremail]);
/* $mail->AddCC($resNewsUsers["emailid"]);
$mail->AddBCC($resNewsUsers["emailid"]);*/
$mail->IsHTML(true); // set email format to HTML
$mail->Subject = $sub;
$mail->Body = $msg;
$mail->AltBody = "This is the body in plain text for non-HTML mail clients";
$mail->Send();
$send=1;
/////////////////////////////////////////////////////////////////////////////////////////////
/////// end /////////
///////////////////////////////////////////////////////////////////////////////////////////
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<form name="formx" method="post">
<center>you can send mails in any languages</center>
<? if($send==1)
{
?>
successfully sent.
<?
}
?>
<br>
name:
<input type='textbox' id="name" name="name"/><br>
<br>
email:
<input type='textbox' id="email" name="email"/><br>
<br>useremail: <input type='textbox' id="useremail" name="useremail"/>
<br>Body<br> <textarea id="transl2" name="transl2" style="width:600px;height:200px"></textarea>
<input type="submit" name="submit" value="murali"></input>
<br><div id="errorDiv"></div>
</form>
</body>
</html>
see once in mail body there is registration form. in that above javascript is there. in my mail i am not entering any fields just clicking submit button then it it zzz redirecting to website. so how i can validate that fields in mail only. any body give suggestions