...

View Full Version : submit button to write to csv or access db



mattnoo
04-21-2011, 06:05 AM
Hi all.

i first off want to say that i have VERY limited programming knowlege, and this will be my first time coding in HTML (using Dreamweaver CS5)

Basically what I am trying to do is automate some of my reporting, to free up some time. The idea is this:

A web page containing combo drop down boxes for standard response types.

When a “submit” button is pressed on the web page, the information will then be written to a Access Database or .CSV, allowing me to run Lookup and countif queries to gain the information on a weekly basis.

At this stage I am able to create a web page with the drop down boxes, however I don’t know how to create the submit button, and then to direct it to write to the Database.
i have attached the code i have so far



<body link="#CC6600" vlink=olive style='margin:0'>

<div style='position:absolute;width:7.-71in;height:3.-1310in'>
<![if !pub]>

<form action=--WEBBOT-SELF-- method=post>
<!--webbot bot="SaveResults" u-file="data.txt"
s-format="TEXT/PRE" s-label-fields="TRUE"
s-builtin-fields="Date Time"-->
<![endif]>

<input name="C:\Users\Matthew\Desktop\web page\data.htm" type=hidden
value="C:\Users\Matthew\Desktop\web page\data.htm">

<!--[if gte vml 1]><v:rect id="_x0000_s1048" alt="" style='position:absolute;
left:0;top:.2pt;width:569.95pt;height:7.2pt;z-index:5;visibility:visible;
mso-wrap-edited:f;mso-wrap-distance-left:2.88pt;mso-wrap-distance-top:2.88pt;
mso-wrap-distance-right:2.88pt;mso-wrap-distance-bottom:2.88pt' fillcolor="#709494 [1 lighten(179)]"
stroked="f" strokecolor="blue" o:cliptowrap="t">
<v:stroke>
<o:left v:ext="view" color="black [0]" color2="white [7]"/>
<o:top v:ext="view" color="black [0]" color2="white [7]"/>
<o:right v:ext="view" color="black [0]" color2="white [7]"/>
<o:bottom v:ext="view" color="black [0]" color2="white [7]"/>
<o:column v:ext="view" color="black [0]" color2="white [7]"/>
</v:stroke>
<v:shadow color="#ccc [4]"/>
<v:path insetpenok="f"/>
<o:lock v:ext="edit" shapetype="t"/>
<v:textbox inset="2.88pt,2.88pt,2.88pt,2.88pt"/>
</v:rect><![endif]--><![if !vml]><span style='position:absolute;z-index:5;
left:0px;top:0px;width:760px;height:10px'><img width=760 height=10
src="index_files/image350.gif" v:shapes="_x0000_s1048"></span><![endif]><!--[if gte vml 1]><v:shapetype
id="_x0000_t201" coordsize="21600,21600" o:spt="201" path="m,l,21600r21600,l21600,xe">
<v:stroke joinstyle="miter"/>
<v:path shadowok="f" o:extrusionok="f" strokeok="f" fillok="f" o:connecttype="rect"/>
<o:lock v:ext="edit" shapetype="t"/>
</v:shapetype><v:shape id="_x0000_s1049" type="#_x0000_t201" style='position:absolute;
left:36pt;top:93pt;width:31.5pt;height:18pt;z-index:6' stroked="f" insetpen="t"
o:cliptowrap="t">
<v:path insetpenok="f"/>
<o:lock v:ext="edit" rotation="t" text="t"/>
</v:shape><![endif]--><![if !pub]><span style='position:absolute;top:93.0pt;
left:36.0pt;z-index:6'><![endif]>

<select name="Call_Number" size=1 v:shapes="_x0000_s1049">
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
</select>

<![if !pub]></span><![endif]><!--[if gte vml 1]><![if mso | ie]><v:shape id="_x0000_s1050"
type="#_x0000_t201" style='position:absolute;left:12pt;top:66pt;width:477pt;
height:24pt;z-index:7;mso-wrap-distance-left:2.88pt;mso-wrap-distance-top:2.88pt;
mso-wrap-distance-right:2.88pt;mso-wrap-distance-bottom:2.88pt' stroked="f"
strokecolor="black [0]" insetpen="t" o:cliptowrap="t">
<v :stroke color2="white [7]">
<o :left v:ext="view" color="black [0]" color2="white [7]" weight="0"/>
<o :top v:ext="view" color="black [0]" color2="white [7]" weight="0"/>
<o :right v:ext="view" color="black [0]" color2="white [7]" weight="0"/>
<o :bottom v:ext="view" color="black [0]" color2="white [7]" weight="0"/>
<o:column v:ext="view" color="black [0]" color2="white [7]"/>
</v:stroke>
<v:shadow color="#ccc [4]"/>
<o:lock v:ext="edit" rotation="t"/>
<v:textbox inset="0,0,0,0">
</v:textbox>
</v:shape><![endif]><![endif]-->

<table v:shapes="_x0000_s1050" cellpadding=0 cellspacing=0 width=636 height=32
border=0 dir=ltr style='width:477.0pt;height:24.0pt;border-collapse:collapse;
position:absolute;top:66.0pt;left:12.0pt;z-index:7'>
<tr>
<td width=85 height=32 valign=Bottom style='width:63.4699pt;height:24.0pt;
padding-left:.75pt;padding-right:.75pt;padding-top:.75pt'>
<p class=MsoNormal style='text-align:center;margin-bottom:14.0pt;text-align:
center'><span lang=en-AU style='font-size:11.0pt;font-family:Calibri;
color:black;language:en-AU'>Call Number</span></p>
</td>
<td width=125 height=32 valign=Bottom style='width:94.0995pt;height:24.0pt;
padding-left:.75pt;padding-right:.75pt;padding-top:.75pt'>
<p class=MsoNormal style='text-align:center;margin-bottom:14.0pt;text-align:
center'><span lang=en-AU style='font-size:11.0pt;font-family:Calibri;
color:black;language:en-AU'>Stage 1</span></p>
</td>
<td width=139 height=32 valign=Bottom style='width:104.0552pt;height:24.0pt;
padding-left:.75pt;padding-right:.75pt;padding-top:.75pt'>
<p class=MsoNormal style='text-align:center;margin-bottom:14.0pt;text-align:
center'><span lang=en-AU style='font-size:11.0pt;font-family:Calibri;
color:black;language:en-AU'>Stage 2</span></p>
</td>
<td width=127 height=32 valign=Bottom style='width:95.1362pt;height:24.0pt;
padding-left:.75pt;padding-right:.75pt;padding-top:.75pt'>
<p class=MsoNormal style='text-align:center;margin-bottom:14.0pt;text-align:
center'><span lang=en-AU style='font-size:11.0pt;font-family:Calibri;
color:black;language:en-AU'>Stage 3</span></p>
</td>
<td width=112 height=32 valign=Bottom style='width:84.2389pt;height:24.0pt;
padding-left:.75pt;padding-right:.75pt;padding-top:.75pt'>
<p class=MsoNormal style='text-align:center;margin-bottom:14.0pt;text-align:
center'><span lang=en-AU style='font-size:11.0pt;font-family:Calibri;
color:black;language:en-AU'>State</span></p>
</td>
<td width=12 height=32 valign=Bottom style='width:9.0pt;height:24.0pt;
padding-left:.75pt;padding-right:.75pt;padding-top:.75pt'>
<p class=MsoNormal style='text-align:center;margin-bottom:14.0pt;text-align:
center'><span lang=en-AU style='font-size:11.0pt;font-family:Calibri;
color:black;language:en-AU'>&nbsp;</span></p>
</td>
<td width=12 height=32 style='width:9.0pt;height:24.0pt;padding-left:.75pt;
padding-right:.75pt;padding-top:.75pt'>
<p class=MsoNormal style='text-align:center;margin-bottom:14.0pt;text-align:
center'><span lang=en-AU style='font-size:11.0pt;font-family:Calibri;
color:black;language:en-AU'>&nbsp;</span></p>
</td>
<td width=12 height=32 valign=Bottom style='width:9.0pt;height:24.0pt;
padding-left:.75pt;padding-right:.75pt;padding-top:.75pt'>
<p class=MsoNormal style='text-align:center;margin-bottom:14.0pt;text-align:
center'><span lang=en-AU style='font-size:11.0pt;font-family:Calibri;
color:black;language:en-AU'>&nbsp;</span></p>
</td>
<td width=12 height=32 valign=Bottom style='width:9.0pt;height:24.0pt;
padding-left:.75pt;padding-right:.75pt;padding-top:.75pt'>
<p class=MsoNormal style='text-align:center;margin-bottom:14.0pt;text-align:
center'><span lang=en-AU style='font-size:11.0pt;font-family:Calibri;
color:black;language:en-AU'>&nbsp;</span></p>
</td>
</tr>
</table>

<!--[if gte vml 1]><v:shape id="_x0000_s1051" type="#_x0000_t201" style='position:absolute;
left:90pt;top:93pt;width:72.75pt;height:18pt;z-index:8' stroked="f"
insetpen="t" o:cliptowrap="t">
<v:path insetpenok="f"/>
<o:lock v:ext="edit" rotation="t" text="t"/>
</v:shape><![endif]--><![if !pub]><span style='position:absolute;top:93.0pt;
left:90.0pt;z-index:8'><![endif]>

<select name="Stage_1" size=1 v:shapes="_x0000_s1051">
<option value=Contact>Contact</option>
<option value="No Contact">No Contact</option>
</select>

<![if !pub]></span><![endif]><!--[if gte vml 1]><v:shape id="_x0000_s1052"
type="#_x0000_t201" style='position:absolute;left:183pt;top:93pt;width:82.5pt;
height:18pt;z-index:9' stroked="f" insetpen="t" o:cliptowrap="t">
<v:path insetpenok="f"/>
<o:lock v:ext="edit" rotation="t" text="t"/>
</v:shape><![endif]--><![if !pub]><span style='position:absolute;top:93.0pt;
left:183.0pt;z-index:9'><![endif]>

<select name="Stage_2" size=1 v:shapes="_x0000_s1052">
<option value="Call Back">Call Back</option>
<option value=Contact>Contact</option>
<option value="Left Message">Left Message</option>
</select>

<![if !pub]></span><![endif]><!--[if gte vml 1]><v:shape id="_x0000_s1053"
type="#_x0000_t201" style='position:absolute;left:303pt;top:93pt;width:61.5pt;
height:18pt;z-index:10' stroked="f" insetpen="t" o:cliptowrap="t">
<v:path insetpenok="f"/>
<o:lock v:ext="edit" rotation="t" text="t"/>
</v:shape><![endif]--><![if !pub]><span style='position:absolute;top:93.0pt;
left:303.0pt;z-index:10'><![endif]>

<select name="Stage_3" size=1 v:shapes="_x0000_s1053">
<option value=Save>Save</option>
<option value="No Save">No Save</option>
<option value=Pending>Pending</option>
</select>

<![if !pub]></span><![endif]><!--[if gte vml 1]><v:shape id="_x0000_s1054"
type="#_x0000_t201" style='position:absolute;left:63pt;top:168pt;width:90.75pt;
height:18pt;z-index:11' stroked="f" insetpen="t" o:cliptowrap="t">
<v:path insetpenok="f"/>
<o:lock v:ext="edit" rotation="t" text="t"/>
</v:shape><![endif]--><![if !pub]><span style='position:absolute;top:168.0pt;
left:63.0pt;z-index:11'><![endif]>

<select name=Company size=1 v:shapes="_x0000_s1054">
<option value=Momentum>Momentum</option>
<option value=AGL>AGL</option>
<option value="Power Direct">Power Direct</option>
<option value="Simply Energy">Simply Energy</option>
<option value=Neighbourhood>Neighbourhood</option>
<option value=Q-Energy>Q-Energy</option>
<option value=Other>Other</option>
</select>

<![if !pub]></span><![endif]><!--[if gte vml 1]><v:shape id="_x0000_s1055"
type="#_x0000_t201" style='position:absolute;left:186pt;top:165pt;width:84pt;
height:18pt;z-index:12' stroked="f" insetpen="t" o:cliptowrap="t">
<v:path insetpenok="f"/>
<o:lock v:ext="edit" rotation="t" text="t"/>
</v:shape><![endif]--><![if !pub]><span style='position:absolute;top:165.0pt;
left:186.0pt;z-index:12'><![endif]>

<select name=Rates size=1 v:shapes="_x0000_s1055">
<option value="&gt; 5%">&gt; 5%</option>
<option value="0%">0%</option>
<option value="&lt; 5%">&lt; 5%</option>
<option value="&lt; 10%">&lt; 10%</option>
<option value="&lt;15%">&lt;15%</option>
<option value="Tender Rates">Tender Rates</option>
</select>

<![if !pub]></span><![endif]><!--[if gte vml 1]><v:shape id="_x0000_s1056"
type="#_x0000_t201" style='position:absolute;left:282pt;top:165pt;width:106.5pt;
height:18pt;z-index:13' stroked="f" insetpen="t" o:cliptowrap="t">
<v:path insetpenok="f"/>
<o:lock v:ext="edit" rotation="t" text="t"/>
</v:shape><![endif]--><![if !pub]><span style='position:absolute;top:165.0pt;
left:282.0pt;z-index:13'><![endif]>

<select name=Reason size=1 v:shapes="_x0000_s1056">
<option value=Un-Authorised>Un-Authorised</option>
<option value=Rates>Rates</option>
<option value=Tender>Tender</option>
<option value="Org Constraints">Org Constraints</option>
<option value="Move Out">Move Out</option>
<option value="No Contact">No Contact</option>
<option value="Not Offered Earlier">Not Offered Earlier</option>
<option value=Other>Other</option>
</select>

<![if !pub]></span><![endif]><!--[if gte vml 1]><v:shape id="_x0000_s1057"
type="#_x0000_t201" style='position:absolute;left:393pt;top:93pt;width:47.25pt;
height:18pt;z-index:14' stroked="f" insetpen="t" o:cliptowrap="t">
<v:path insetpenok="f"/>
<o:lock v:ext="edit" rotation="t" text="t"/>
</v:shape><![endif]--><![if !pub]><span style='position:absolute;top:93.0pt;
left:393.0pt;z-index:14'><![endif]>

<select name=State size=1 v:shapes="_x0000_s1057">
<option value=Vic>Vic</option>
<option value=NSW>NSW</option>
<option value=SA>SA</option>
<option value=QLD>QLD</option>
</select>

<![if !pub]></span><![endif]><!--[if gte vml 1]><v:shape id="_x0000_s1058"
type="#_x0000_t201" style='position:absolute;left:420pt;top:165pt;width:37.5pt;
height:18pt;z-index:15' stroked="f" insetpen="t" o:cliptowrap="t">
<v:path insetpenok="f"/>
<o:lock v:ext="edit" rotation="t" text="t"/>
</v:shape><![endif]--><![if !pub]><span style='position:absolute;top:165.0pt;
left:420.0pt;z-index:15'><![endif]>

<select name=Site size=1 v:shapes="_x0000_s1058">
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
<option value=5>5</option>
<option value="6+">6+</option>
</select>

<![if !pub]></span><![endif]><!--[if gte vml 1]><![if mso | ie]><v:shape id="_x0000_s1059"
type="#_x0000_t201" style='position:absolute;left:39pt;top:141pt;width:424.21pt;
height:21pt;z-index:16;mso-wrap-distance-left:2.88pt;mso-wrap-distance-top:2.88pt;
mso-wrap-distance-right:2.88pt;mso-wrap-distance-bottom:2.88pt' stroked="f"
strokecolor="black [0]" insetpen="t" o:cliptowrap="t">
<v:stroke color2="white [7]">
<o:left v:ext="view" color="black [0]" color2="white [7]" weight="0"/>
<o:top v:ext="view" color="black [0]" color2="white [7]" weight="0"/>
<o:right v:ext="view" color="black [0]" color2="white [7]" weight="0"/>
<o:bottom v:ext="view" color="black [0]" color2="white [7]" weight="0"/>
<o:column v:ext="view" color="black [0]" color2="white [7]"/>
</v:stroke>
<v:shadow color="#ccc [4]"/>
<o:lock v:ext="edit" rotation="t"/>
<v:textbox inset="0,0,0,0">
</v:textbox>
</v:shape><![endif]><![endif]-->

<table v:shapes="_x0000_s1059" cellpadding=0 cellspacing=0 width=566 height=28
border=0 dir=ltr style='width:424.21pt;height:21.0pt;border-collapse:collapse;
position:absolute;top:141.0pt;left:39.0pt;z-index:16'>
<tr>
<td width=186 height=28 valign=Bottom style='width:139.6464pt;height:21.0pt;
padding-left:.75pt;padding-right:.75pt;padding-top:.75pt'>
<p class=MsoNormal style='text-align:center;margin-bottom:14.0pt;text-align:
center'><span lang=en-AU style='font-size:11.0pt;font-family:Calibri;
color:black;language:en-AU'>Company</span></p>
</td>
<td width=126 height=28 style='width:94.3535pt;height:21.0pt;padding-left:
.75pt;padding-right:.75pt;padding-top:.75pt'>
<p class=MsoNormal style='text-align:center;margin-bottom:14.0pt;text-align:
center'><span lang=en-AU style='font-size:11.0pt;font-family:Calibri;
color:black;language:en-AU'>Rates</span></p>
</td>
<td width=180 height=28 valign=Bottom style='width:135.0pt;height:21.0pt;
padding-left:.75pt;padding-right:.75pt;padding-top:.75pt'>
<p class=MsoNormal style='text-align:center;margin-bottom:14.0pt;text-align:
center'><span lang=en-AU style='font-size:11.0pt;font-family:Calibri;
color:black;language:en-AU'>Reason</span></p>
</td>
<td width=74 height=28 valign=Bottom style='width:55.2195pt;height:21.0pt;
padding-left:.75pt;padding-right:.75pt;padding-top:.75pt'>
<p class=MsoNormal style='text-align:center;margin-bottom:14.0pt;text-align:
center'><span lang=en-AU style='font-size:11.0pt;font-family:Calibri;
color:black;language:en-AU'>Site #</span></p>
</td>
</tr>
</table>

<!--[if gte vml 1]><v:shape id="_x0000_s1062" type="#_x0000_t201" style='position:absolute;
left:204pt;top:222pt;width:48pt;height:17.25pt;z-index:17' stroked="f"
insetpen="t" o:cliptowrap="t">
<v:path insetpenok="f"/>
<o:lock v:ext="edit" rotation="t" text="t"/>
</v:shape><![endif]--><![if !pub]><span style='position:absolute;top:222.0pt;
left:204.0pt;z-index:17'><![endif]>

< $sfp = fopen [index.htm](/C:\Documents and Settings\noonanm\Desktop\web page\db1.csv','r);>
<$dfp = fopen (/C:\Documents and Settings\noonanm\Desktop\web page\db1.csv','w);>
<($row = fgetcsv [ca.php.net]($sfp,10000,",","")) {} >
<fwrite [index.htm]($dfp,$index.htm);
<fclose($sfp); fclose($dfp); ? >




<input type=submit value=Submit v:shapes="_x0000_s1062"<?php




<![if !pub]></span><![endif]><![if !pub]>
</form>

<![endif]>
</div>

</body>

</html>

i have searched for everything i can find and nothing has helped, hoping someone here can.


-Matt

BoyWander
04-21-2011, 08:15 AM
When you post code on this forum, use code brackets by clicking the # button directly above this text. It will make it a lot easier for us all to read.

mattnoo
04-21-2011, 09:02 AM
Thanks for the heads up with the code >.< as i said new to this.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum