R
Richard
I need to add an automatic furnace filter change reminder page for our
customers. I have some basic code but it uses javascript and ASP but my
webhost uses PHP. Any suggestions on how I can make this work?
Here's the code I have so far:
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<meta name="Microsoft Theme" content="fmi-blends 1011, default">
<meta name="Microsoft Border" content="tlb, default">
</head>
<body>
<!-- the middle row contains the page content and sidebar -->
<tr>
<td>
<!-- this table will split the middle row into 3 columns -->
<table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr>
<!-- this is the sidebar -->
<td width="800" valign="top" class="sidebar">
<script language="JavaScript">
<!--
var date_arr = new Array;
var days_arr = new Array;
date_arr[0]=new Option("January",31);
date_arr[1]=new Option("February",28);
date_arr[2]=new Option("March",31);
date_arr[3]=new Option("April",30);
date_arr[4]=new Option("May",31);
date_arr[5]=new Option("June",30);
date_arr[6]=new Option("July",31);
date_arr[7]=new Option("August",30);
date_arr[8]=new Option("September",30);
date_arr[9]=new Option("October",31);
date_arr[10]=new Option("November",31);
date_arr[11]=new Option("December",30);
function initdate()
{
return(true);
}
function fill_select(f, first_time)
{
var curdate = new Date();
var mon = curdate.getMonth();
document.writeln("<SELECT name=\"months\"
onchange=\"update_days(FRM, false)\">");
for(x=0;x<12;x++)
{
document.writeln("<OPTION ");
if(first_time == true)
{
if(mon == x)
{
document.writeln(" selected ");
}
}
document.writeln("value=\""+date_arr[x].value+"\">"+date_arr[x].text+"</OPTION>");
}
document.writeln("</SELECT> <SELECT name=\"days\"></SELECT>");
selection=f.months[f.months.selectedIndex].value;
}
function update_days(f, first_time)
{
var curdate = new Date();
var day = curdate.getDate();
temp=f.days.selectedIndex;
for(x=days_arr.length;x>0;x--)
{
days_arr[x]=null;
f.days.options[x]=null;
}
selection=parseInt(f.months[f.months.selectedIndex].value);
ret_val = 0;
if(f.months[f.months.selectedIndex].value == 28)
{
year=parseInt(f.years.options[f.years.selectedIndex].value);
if (year % 4 != 0 || year % 100 == 0 ) ret_val=0;
else
if (year % 400 == 0) ret_val=1;
else
ret_val=1;
}
selection = selection + ret_val;
for(x=1;x < selection+1;x++)
{
days_arr[x-1]=new Option(x);
f.days.options[x-1]=days_arr[x-1];
}
if (temp == -1)
{
f.days.options[(day - 1)].selected=true;
} else {
f.days.options[temp].selected=true;
}
}
function year_install(f, first_time)
{
var curdate = new Date();
var year = curdate.getFullYear();
document.writeln("<SELECT name=\"years\"
onchange=\"update_days(FRM)\">");
for(x=year;x<(year+10);x++){
document.writeln("<OPTION value=\""+x+"\">"+x+"</OPTION>");
}
document.writeln("</SELECT>");
update_days(f, first_time);
}
-->
</script>
<table width='100%'><tr><td rowspan=2 style='padding-right: 5px;'><img
src='images/calendar.gif'></td><td valign=bottom class=textcat
width='100%'><b>Filter Change Reminder</b></td></tr><tr><td valign=top
class=textsmall>Fill out the form below and we will send you a filter change
reminder at the interval you specify.</td></tr><tr><td colspan=2
class=textsmall><hr size=1 width='100%' noshade></td></tr></table><table
width='100%' cellpadding='3' cellspacing='0'>
<form name='FRM' method=POST action='--WEBBOT-SELF--'
onSubmit="document.FRM.start_month.value=(document.FRM.months.selectedIndex +
1);">
<!--webbot bot="SaveResults"
S-Email-Address="(e-mail address removed)"
S-Email-Format="TEXT/PRE" --><input type='hidden' name='return_url'
value='http://www.iaqsource.com/index.php?module=filter_reminder&success=1'><input
type='hidden' name='site_url' value='http://www.iaqsource.com/'><input
type='hidden' name='site_name' value='www.iaqsource.com'><input type='hidden'
name='email_subj' value='Filter Change Reminder - www.iaqsource.com'><input
type='hidden' name='action_line' value='Need replacement filters? Visit
http://www.iaqsource.com/'><input type='hidden' name='start_month'
value='0'><tr><td class=textsmall>Email:</td><td class=textsmall colspan=2
width='100%'><input type=text name=email value='' maxlength=255 style="width:
100%;"></td></tr><tr><td class=textsmall>Every:</td><td
class=textsmall><input type=radio name=frequency value=30 checked></td><td
class=textsmall width='100%'>30 days</td></tr><tr><td
class=textsmall> </td><td class=textsmall><input type=radio name=frequency
value=60></td><td class=textsmall width='100%'>60 days</td></tr><tr><td
class=textsmall> </td><td class=textsmall><input type=radio name=frequency
value=90></td><td class=textsmall width='100%'>90 days</td></tr><tr><td
class=textsmall> </td><td class=textsmall><input type=radio name=frequency
value=180></td><td class=textsmall width='100%'>6 months</td></tr><tr><td
class=textsmall> </td><td class=textsmall><input type=radio name=frequency
value=365></td><td class=textsmall width='100%'>1 year</td></tr><tr><td
class=textsmall> </td><td class=textsmall><input type=radio name=frequency
value=-1></td><td class=textsmall width='100%'>Custom: <input type=text
name=custom maxlength=3 size=4 value=30> Days (must be > 0)</td></tr><tr><td
class=textsmall valign=top>Starting:</td><td class=textsmall colspan=2
width='100%'><SCRIPT>fill_select(document.FRM,
true);year_install(document.FRM, true)</script><br>First reminder is sent X
days after start date, and every X days after that</td></tr><tr><td
class=textsmall valign=top>Message:</td><td class=textsmall
colspan=2><textarea rows=7 name=comments style="width: 100%;">Time to change
the furnace/AC filter!</textarea><br>Use the box above to send yourself a
custom reminder</td></tr><tr><td colspan=3 align=center><input type=submit
name=submit value='Submit'></td></tr></form></table> </td>
<!-- this is the page content -->
<!-- this is the right column -->
</tr>
</table>
</td>
</tr>
<!-- the last row contains the page footer, and some site links -->
<tr>
<td class="bottombar">
</td>
</tr>
</table>
</div>
<script language="JavaScript" src="./wz_tooltip.js"
type="text/javascript"></script>
</body>
</html>
</body></html>
customers. I have some basic code but it uses javascript and ASP but my
webhost uses PHP. Any suggestions on how I can make this work?
Here's the code I have so far:
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<meta name="Microsoft Theme" content="fmi-blends 1011, default">
<meta name="Microsoft Border" content="tlb, default">
</head>
<body>
<!-- the middle row contains the page content and sidebar -->
<tr>
<td>
<!-- this table will split the middle row into 3 columns -->
<table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr>
<!-- this is the sidebar -->
<td width="800" valign="top" class="sidebar">
<script language="JavaScript">
<!--
var date_arr = new Array;
var days_arr = new Array;
date_arr[0]=new Option("January",31);
date_arr[1]=new Option("February",28);
date_arr[2]=new Option("March",31);
date_arr[3]=new Option("April",30);
date_arr[4]=new Option("May",31);
date_arr[5]=new Option("June",30);
date_arr[6]=new Option("July",31);
date_arr[7]=new Option("August",30);
date_arr[8]=new Option("September",30);
date_arr[9]=new Option("October",31);
date_arr[10]=new Option("November",31);
date_arr[11]=new Option("December",30);
function initdate()
{
return(true);
}
function fill_select(f, first_time)
{
var curdate = new Date();
var mon = curdate.getMonth();
document.writeln("<SELECT name=\"months\"
onchange=\"update_days(FRM, false)\">");
for(x=0;x<12;x++)
{
document.writeln("<OPTION ");
if(first_time == true)
{
if(mon == x)
{
document.writeln(" selected ");
}
}
document.writeln("value=\""+date_arr[x].value+"\">"+date_arr[x].text+"</OPTION>");
}
document.writeln("</SELECT> <SELECT name=\"days\"></SELECT>");
selection=f.months[f.months.selectedIndex].value;
}
function update_days(f, first_time)
{
var curdate = new Date();
var day = curdate.getDate();
temp=f.days.selectedIndex;
for(x=days_arr.length;x>0;x--)
{
days_arr[x]=null;
f.days.options[x]=null;
}
selection=parseInt(f.months[f.months.selectedIndex].value);
ret_val = 0;
if(f.months[f.months.selectedIndex].value == 28)
{
year=parseInt(f.years.options[f.years.selectedIndex].value);
if (year % 4 != 0 || year % 100 == 0 ) ret_val=0;
else
if (year % 400 == 0) ret_val=1;
else
ret_val=1;
}
selection = selection + ret_val;
for(x=1;x < selection+1;x++)
{
days_arr[x-1]=new Option(x);
f.days.options[x-1]=days_arr[x-1];
}
if (temp == -1)
{
f.days.options[(day - 1)].selected=true;
} else {
f.days.options[temp].selected=true;
}
}
function year_install(f, first_time)
{
var curdate = new Date();
var year = curdate.getFullYear();
document.writeln("<SELECT name=\"years\"
onchange=\"update_days(FRM)\">");
for(x=year;x<(year+10);x++){
document.writeln("<OPTION value=\""+x+"\">"+x+"</OPTION>");
}
document.writeln("</SELECT>");
update_days(f, first_time);
}
-->
</script>
<table width='100%'><tr><td rowspan=2 style='padding-right: 5px;'><img
src='images/calendar.gif'></td><td valign=bottom class=textcat
width='100%'><b>Filter Change Reminder</b></td></tr><tr><td valign=top
class=textsmall>Fill out the form below and we will send you a filter change
reminder at the interval you specify.</td></tr><tr><td colspan=2
class=textsmall><hr size=1 width='100%' noshade></td></tr></table><table
width='100%' cellpadding='3' cellspacing='0'>
<form name='FRM' method=POST action='--WEBBOT-SELF--'
onSubmit="document.FRM.start_month.value=(document.FRM.months.selectedIndex +
1);">
<!--webbot bot="SaveResults"
S-Email-Address="(e-mail address removed)"
S-Email-Format="TEXT/PRE" --><input type='hidden' name='return_url'
value='http://www.iaqsource.com/index.php?module=filter_reminder&success=1'><input
type='hidden' name='site_url' value='http://www.iaqsource.com/'><input
type='hidden' name='site_name' value='www.iaqsource.com'><input type='hidden'
name='email_subj' value='Filter Change Reminder - www.iaqsource.com'><input
type='hidden' name='action_line' value='Need replacement filters? Visit
http://www.iaqsource.com/'><input type='hidden' name='start_month'
value='0'><tr><td class=textsmall>Email:</td><td class=textsmall colspan=2
width='100%'><input type=text name=email value='' maxlength=255 style="width:
100%;"></td></tr><tr><td class=textsmall>Every:</td><td
class=textsmall><input type=radio name=frequency value=30 checked></td><td
class=textsmall width='100%'>30 days</td></tr><tr><td
class=textsmall> </td><td class=textsmall><input type=radio name=frequency
value=60></td><td class=textsmall width='100%'>60 days</td></tr><tr><td
class=textsmall> </td><td class=textsmall><input type=radio name=frequency
value=90></td><td class=textsmall width='100%'>90 days</td></tr><tr><td
class=textsmall> </td><td class=textsmall><input type=radio name=frequency
value=180></td><td class=textsmall width='100%'>6 months</td></tr><tr><td
class=textsmall> </td><td class=textsmall><input type=radio name=frequency
value=365></td><td class=textsmall width='100%'>1 year</td></tr><tr><td
class=textsmall> </td><td class=textsmall><input type=radio name=frequency
value=-1></td><td class=textsmall width='100%'>Custom: <input type=text
name=custom maxlength=3 size=4 value=30> Days (must be > 0)</td></tr><tr><td
class=textsmall valign=top>Starting:</td><td class=textsmall colspan=2
width='100%'><SCRIPT>fill_select(document.FRM,
true);year_install(document.FRM, true)</script><br>First reminder is sent X
days after start date, and every X days after that</td></tr><tr><td
class=textsmall valign=top>Message:</td><td class=textsmall
colspan=2><textarea rows=7 name=comments style="width: 100%;">Time to change
the furnace/AC filter!</textarea><br>Use the box above to send yourself a
custom reminder</td></tr><tr><td colspan=3 align=center><input type=submit
name=submit value='Submit'></td></tr></form></table> </td>
<!-- this is the page content -->
<!-- this is the right column -->
</tr>
</table>
</td>
</tr>
<!-- the last row contains the page footer, and some site links -->
<tr>
<td class="bottombar">
</td>
</tr>
</table>
</div>
<script language="JavaScript" src="./wz_tooltip.js"
type="text/javascript"></script>
</body>
</html>
</body></html>