Att: MAB
Your making this sound very complicated,
all i need is this code to work in my site which was originally ok before i changed my host account (from "ASP Windows" ) to ("PHP Linux") <html>
my code form:
<head><script LANGUAGE="JavaScript">
<!-- Begin
function getCookie(name){
var cname = name + "=";
var dc = document.cookie;
if (dc.length > 0) {
begin = dc.indexOf(cname);
if (begin != -1) {
begin += cname.length;
end = dc.indexOf(";", begin);
if (end == -1) end = dc.length;
return unescape(dc.substring(begin, end));
}
}
return null;
}
function setCookie(name, value, expires) {
document.cookie = name + "=" + escape(value) +
((expires != null) ? "; expires=" + expires.toGMTString() : "")
+ "; path=/";
}
function setName() {
var expdate = new Date ();
expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000 * 365));
var prompt=i = document.Mail.name.value;
setCookie("name", i, expdate);
}
function getName() {
if(getCookie("name") != null) {
document.Mail.Name.value = getCookie("emailname");
}
}
function getInfo() {
var now= new Date();
document.Mail.Info.value = "Browser: " + navigator.userAgent;
document.Mail.Info.value += "Date:" + now;
}
function checkMultiple() {
if (getCookie("emailsent") == 'true') return true;
else return false;
}
function process() {
setCookie("emailsent", "true");
with (document.Mail) {
if (Subject.selectedIndex == 1) action = "mailto:my@email.com?subject=TJS - Comment";
else if (Subject.selectedIndex == 2) action = "mailto:my@email.com?subject=TJS - Question";
else if (Subject.selectedIndex == 3) action = "mailto:my@email.com?subject=TJS - Suggestion";
else if (Subject.selectedIndex == 4) action = "mailto:my@email.com?subject=TJS - Broken Link";
else action = "mailto:my@email.com?subject=TJS - Other";
}
}
function formCheck() {
var passed = false;
with (document.Mail) {
if (Subject.selectedIndex == 0) {
alert("Please pick a subject.");
Subject.focus();
}
else if (Name.value == "") {
alert("Please inlcude your name.");
Name.focus();
}
else if (checkMultiple()) {
if (confirm("You just sent an e-mail from this form, are you sure you want to send another?")) {
process();
passed = true;
}
}
else {
process();
passed = true;
}
}
return passed;
}
// End -->
</script>
<title></title><!--content start-->
<table WIDTH="50%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
<tr>
<table width="1" border="0" cellspacing="0" cellpadding="0">
<tr>
<th bgcolor="#99CCFF" scope="col"><form NAME="Mail" ACTION="mailto:my@email.com?subject=TJS - Form"
METHOD="POST" ENCTYPE="text/plain" onSubmit="return formCheck();">
<table width="878" BORDER="0" CELLPADDING="10" CELLSPACING="0">
<tr>
<td width="161"><span class="style86">* Name:
</span> <input TYPE="text" NAME="Name" onChange="setName()" size="20">
</td>
<td width="144"><span class="style86">*Phone:
</span> <input TYPE="text" NAME="Phone" onChange="setName()" size="20">
</td>
<td width="120"><span class="style86">*Email:
</span> <input TYPE="text" NAME="Email" onChange="setName()" size="20">
</td>
<td width="120"><span class="style86">*Website URL:
</span> <input TYPE="text" NAME="Website URL" onChange="setName()" size="20">
</td>
<td width="233" ALIGN="RIGHT" valign="top"> <div align="left"><span class="style86">*Upload Photo/s & Logo
<input type="file" name="user_file">
</span></div></td>
</tr>
<tr>
<td COLSPAN="2" valign="top"><p><span class="style86"> Listing: </span></p>
<p><span class="style86">
<select NAME="Subject" size="1">
<option SELECT>Type of Advertising Required</option>
<option>1. Fried Rice - 1 Year</option>
<option>2. Eat bacon - 6 Months</option>
<option>3. Salty Fish - 3 Months</option>
<option>4. Sloppy Pizza - 3 Months</option>
<option>5. Sticky Chips - 1 Year</option>
</select>
</span><br>
</p></td>
<td colspan="3" align="left" valign="top"><p class="style86">Description: (Max 150 Letters) </p>
<p class="style86">
<textarea NAME="Comments, Suggestions" COLS="50" ROWS="6">
</textarea>
</p></td>
</tr>
</table>
<div align="center">
<center>
<table>
<tr>
<td align="center"><input TYPE="submit" VALUE="Send">
<script LANGUAGE="JavaScript">
<!-- Begin
getInfo();
getName();
// End -->
</script></td>
</tr>
</table>
</center>
</div>
</form></th>
</tr>
</table>
</td>
</tr>
</table>
<!--content stop-->
</body>
</html>
</form>
</TD>
</TR></TBODY></TABLE></P>
<P align=center> </P>
</TD>
</TR>
<TR>
<TD vAlign=top align=left height=460>
<TABLE id=Table3 borderColor=#ffffff height="100%" cellSpacing=0
cellPadding=0 width="100%" border=0 wsc_noborder>
<TBODY>
<TR>
<TD id=Section4 vAlign=top align=right height=30><p> </p>
<p> </p>
</TD></TR>
<TR>
<TD id=Section5 vAlign=bottom align=center width="100%" height=30>
<p><SPAN>
</SPAN></p>
<p> </p>
<P align=center> </P>
</TD>
</TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
</BODY></HTML>