[thelist] Help Finding & Fixing VBScript Error... Arrrgghhh!
Administrative HQ
english_offline at yahoo.com
Mon Mar 14 13:26:27 CST 2005
Hello.
Thanks for answering. This is what I've been trying to
avoid (sending the whole thing) as I hate to be a
nuisance.
Sorry. Here goes:
***************************
1 <%@ Language=VBScript %>
2 <%'update dbase for cd order%>
3
4 <!--#include file="sendmailinc.asp" -->
5
6 <SCRIPT ID=clientEventHandlersJS
LANGUAGE=javascript>
7 <%
8
9 'sub sendmail(rec, from, subj, body, [cc], [lang],
[attach], [other])
10 'end sub
11
12
13
14 if request("details")="true" then
15 dim theprice
16 if request("p2")="y" then
17 theprice=2
18 else
19 theprice=1
20 end if
21
22 lan=request("lang")
23
24 Dim ConnectionString
25 ConnectionString = application("dbase")
26
27
28 Dim Connection
29 Set Connection =
Server.CreateObject("ADODB.Connection")
30 Connection.ConnectionTimeout = 30
31 Connection.CommandTimeout = 80
32 Connection.Open ConnectionString
33 ' Create a RecordSet Object
34 dim cm
35 Dim rs
36 set rs = Server.CreateObject("ADODB.RecordSet")
37 usr=request("usrname")
38 pas=request("password")
39
40 fn=request("first_name")
41 ln=request("last_name")
42 ' Retrieve the records
43 'check that user does not exsist
44 rs.Open "SELECT * FROM users where
UsrEmail='"&usr&"'", Connection', adOpenForwardOnly,
adLockOptimistic
45
46 if not rs.EOF then
47 if rs.Fields("UsrPass")=pas then
48 if rs.Fields("Status")=0 then
49 UsrCd=rs.Fields("UsrCd")
50
51 set cm = Server.CreateObject("ADODB.Command")
52 cm.ActiveConnection = Connection
53 cm.CommandText = "UPDATE users set
price="&theprice&", PaymentMethod="&request("pay")&"
where UsrEmail='"&usr&"'"
54 cm.execute
55
56
57 'create the hidden filed that is the userid
created for the papal system
58 Response.Write "<input type='hidden' name='cust'
id='cust' value='"&eval(UsrCd)&"'>"
59 'session("curUsr")=UsrCd
60
61 'set the redirect
62 redirect=request("pay")
63
64 'not really used
65 err=4'user updated sucsessfully
66 else
67 err=5' sorry but you are unable to change your
details, please contact admin
68 end if
69
70 elseif request("p2")="y" then
71 'sorry you have already created a user, please
enter the password you used
72 'to enable us to update your details and claim
your 2nd prize discount
73 err=2
74 else
75 'You appear to have already created a user, please
enter your origional password to
76 'enable us to update your details.
77 'err contact us..
78 err=1
79 end if
80 else
81
82
83
84 set cm = Server.CreateObject("ADODB.Command")
85 cm.ActiveConnection = Connection
86 cm.CommandText = "INSERT INTO users(Type, Number,
Expiry, Amount, Monthly) values('"_
87 & Type &"','"_
88 & Number &"','"_
89 & Expiry &"','"_
90 & Amount &"','"_
91 & Monthly &"')"
92 cm.execute
93
94 'Response.Write "<FONT color=red><h2>user added
sucsessfully</h2></font><br>"
95 rs.close
96
97 'send email to user to confirm his login details
98
99 'Dim objCDO
100 'Set objCDO =
Server.CreateObject("CDONTS.NewMail")
101 'objCDO.From = "Administration at MySite.net"
102 'objCDO.To = "Accounting at Mysite.net"
103
104 'here is the code in 3 languages for the email
sent once the user is created.
105 Select Case lan
106 Case "en"
107 subj = "Feedback Form"
108 body = "Form Info:"&chr(10) &" " & chr(10)
&"Type: "&Type&chr(10) & chr(10)&"Amount:
"&Amount&chr(10) & chr(10)&"Monthly: "&Monthly&chr(10)
& chr(10) &"End" &chr(10)
109 sendmail usr, "Administration at Mysite.net",
subj, body,"" , lan, "",""
110 case "he"
111 subj = "áøåëéí äáàéí"
112
113 'body = "<html lang=he dir=rtl>"&"çáø/ä
ðëáã/ä"& "<br><p>" & "éöøú áäöìçä àú æéäåé äîùúîù
ùìê"&"<br><br>"_
114 '& "ùí äîùúîù ùìê äéðå"&": "& usr &"<br><br>"_
115 '& "äñéñîä ùìê äéðä"&": "& pas& "<br><br>"_
116 '& "äëðéñä úúàôùø îééã òí äùìîú úäìéê
äúùìåí."_
117 '& "ëãé ìäëðñ éù ìâìåù ìàúøðå" &"<br>"_
118 '&"<a
href='http://www.MySite.net/ivrit/index.shtm'>www.MySite.net</a>"_
119 '&"<br> åììçåõ òì ä÷éùåø ìçáøéí <br><br>"_
120 '&"áî÷øä ùì ÷ùééí àôùø ìëúåá ìëúåáú"&"<br>"_
121 '&"<a
href='mailto:help at MySite.net'>help at MySite.net</a><br><br>"_
122 '&"úåãä åáøåê/ä äáà/ä"_
123 '&"</html>"
124 body="<HTML lang='he' dir='rtl'>"_
125 &"<HEAD><TITLE>áøåëéí äáàéí</TITLE></HEAD>"_
126 &"<BODY bgcolor='white' text='black'
link='blue' vlink='purple' alink='red'>"_
127 &"<TABLE width='100%'><TR><TD
align='right'>çáø/ä ðëáã/ä</TD></TR>"_
128 &"<TR><TD> </TD></TR>"_
129 &"<TR><TD align='right'>éöøú áäöìçä àú æéäåé
äîùúîù ùìê</TD></TR>"_
130 &"<TR><TD> </TD></TR>"_
131 &"<TR><TD align='right'>ùí äîùúîù ùìê
äéðå</TD></TR>"_
132 &"<TR><TD
align='right'><b>"&usr&"</b></TD></TR>"_
133 &"<TR><TD align='right'>äñéñîä ùìê
äéðä</TD></TR>"_
134 &"<TR><TD
align='right'><b>"&pas&"</b></TD></TR>"_
135 &"<TR><TD> </TD></TR>"_
136 &"<TR><TD align='right'>äëðéñä úúàôùø îéã òí
äùìîú úäìéê äúùìåí</TD></TR>"_
137 &"<TR><TD align='right'>ëãé ìäëðñ éù ìâìåù
ìàúøðå</TD></TR>"_
138 &"<TR><TD align='right'><A
HREF='http://www.MySite.net/ivrit/index.shtm'>www.MySite.net</A></TD>"_
139 &"</TR><TR> <TD align='right'>åìä÷ì÷ òì ä÷éùåø
ìçáøéí</TD></TR>"_
140 &"<TR><TD> </TD></TR>"_
141 &"<TR><TD align='right'>áî÷øä ùì ÷ùééí àôùø
ìëúåá ìëúåáú äáàä</TD></TR>"_
142 &"<TR><TD align='right'><A
href='mailto:help at MySite.net'>help at MySite.net</A></TD>"_
143 &"</tr><TR><TD> </TD></TR>"_
144 &"<TR><TD align='right'>úåãä åáøåê/ä
äáà/ä</TD></TR>"_
145 &"</TABLE></BODY></HTML>"
146
147 sendmail usr, "admin at MySite.net", subj,
body,"" , lan, "","HTML"
148
149 'send again not html
150 'body = "çáø/ä ðëáã/ä"&chr(10) &" " & chr(10)
&"éöøú áäöìçä àú æéäåé äîùúîù ùìê"&chr(10)&chr(10)&"ùí
äîùúîù ùìê äéðå"&chr(10)&usr&chr(10)&"äñéñîä ùìê
äéðä"&chr(10)&pas&""&chr(10) &" " & chr(10)&"äëðéñä
úúàôùø îééã òí äùìîú úäìéê äúùìåí."&chr(10)&"ëãé ìäëðñ
éù ìâìåù ìàúøðå"&chr(10)&"www.MySite.net"&chr(10)&"ìçõ
òì ä÷éùåø ìòáøéú"&chr(10)&"áãó äáéú áòáøéú, ìçõ òì
ä÷éùåø ìçáøéí "&chr(10)&chr(10)&"áî÷øä ùì ÷ùééí àôùø
ìëúåá ìëúåáú:"&chr(10)&"help at MySite.net
"&chr(10)&chr(10)&"úåãä åáøåê/ä äáà/ä"&chr(10)
151 'sendmail usr, "admin at MySite.net", subj,
body,"" , lan, "",""
152 case "es"
153 subj = "Bienvenido a MySite.net"
154 body = "Estimado Miembro,"&chr(10) & chr(10)
&"Bienvenido a MySite.net. Se inscribió con
éxito."&chr(10)&chr(10)&"Su nombre de Usuario es:
"&usr&chr(10)&"Su contraseña es: "&pas&chr(10) &
chr(10)&"Podrá entrar después de confirmación del
pago."&chr(10)&"Para entrar, visítenos a
www.MySite.net. Hay un enlace para 'español'. En la
página de inicio en español, oprima sobre el enlace
'Para Miembros'."&chr(10)&chr(10)&"Si necesita ayuda
puede escribirnos a
help at MySite.net."&chr(10)&chr(10)&"Muchas gracias y
bienvenido."&chr(10)
155 sendmail usr, "admin at MySite.net", subj,
body,"" , lan, "",""
156 end select
157
158
159
160 redirect=request("pay")
161
162
163
164
165
166
167 set cm=nothing
168 rs.Close
169 set rs = nothing
170 Connection.Close
171 Set Connection = nothing
172
173
174
175
176 %>
177
178 function window_onload()
179
document.getElementById("UsrId").value=document.getElementById("cust").value
180
181 //alert(document.getElementById("UsrId").value);
182
183 function snd_onclick() {
184 document.getElementById("snd").disabled=true;
185 var dosub=true;
186
187 if (document.getElementById("Type").value=="")
188 {
189 alert("Sorry, but we need to know the type
...");
190 dosub=false;
191 }
192
193 if (document.getElementById("Number").value=="")
194 {
195 alert("Sorry, but please enter ... number.");
196 dosub=false;
197 }
198 if (document.getElementById("Expiry").value=="")
199 {
200 alert("Sorry, but please enter your ...");
201 dosub=false;
202 }
203 if (document.getElementById("Amount").value=="")
204 {
205 alert("Sorry, but please enter an amount.");
206 dosub=false;
207 }
208
209
210 if (document.getElementById("Monthly").value=="")
211 {
212 alert("Sorry, please indicate "yes" or "no".");
213 dosub=false;
214 }
215
216
217
218
219 //check password more than 4 chars
220
221
222 if (dosub==true)
223 {
224//
document.getElementById("custom").value=document.getElementById("password").value
+"|"+ document.getElementById("usrname").value
225 document.bacs_frm.submit();
226 }
227 document.getElementById("snd").disabled=false;
228 }
229
230 //-->
231 </SCRIPT>
232
233<HTML lang="en" dir="ltr">
234 <head>
235<title></title>
236 <!--#include file="ChesedTemplate.txt" -->
237 <table width="640">
238 <tr>
239 <td valign="bottom"><img src="blank.gif"
width="80" height="1"></td>
240 <table width=640 border=0 cellpadding=0
cellspacing=0><tr><td valign=bottom><img src=blank.gif
width=40 height=1></td>
241 <!--<h1>Step 2 - Payment</h1>-->
242 <td valign=top width=100%><font
face="verdana, sans-serif" color="#000066"
size="6">Sample</font>
243
244 <br>
245 <img src="blank.gif" width="160"
height="1"></h2>
246 <!--<p>Please fill out the form completely
and send it to us.
247
248 <%if Request("p2")="y" then%>
249 <p>Payment in the amount (US
$<%=application("prize2price")%>) should be sent to:
250 <%elseif request("cd")="y" then%>
251 <p>Payment in the amount (US
$<%=application("cdprice")%>) should be sent to:
252 <%else%>
253 <p>Payment in the amount (US
$<%=application("regprice")%>) should be sent to
254 <%end if%>
255 Address:-->
256
257 <p></p>
258
259 <form action="sendmail.asp" method="post"
name="bacs_frm" id="bacs_frm" en_ctype="text/plain">
260 <input name="recipient" type="hidden"
value="forms at MySite.net">
261 <input name="subject" type="hidden"
value="PayByBacs_Form_EN">
262 <input name="redirect" type="hidden"
value="orderconfirm.shtm">
263
264 <input TYPE="HIDDEN" NAME="Registration"
VALUE="Registration">
265
266 <input type="hidden" name="UsrId"
id="UsrId" value="<%=request("cust")%>
267 <input type="hidden" name="amount"
id="amount" value="<%if request("p2")="y" then
268 Response.Write "$"&application("prize2price")
269 elseif request("cd")="y" then
270 Response.Write "$"&application("cdprice")
271 else
272 Response.Write "$"&application("regprice")
273 end if
274 %>
275 <table class="form" width="400"
cellspacing="1" cellpadding="2" border="1"
bgcolor="#99ccff">
276
277 <tr>
278 <td align="left"
bgcolor="#88ddff"> </td>
279 <td valign="top">
280 <input size="20" TYPE="HIDDEN"
name="Name" id="Name" value="<%'=request("last_name")
& ", " & Response.write(request("first_name"))%>
281 </td>
282 </tr>
283 <!--<tr>
284 <td align="left"
bgcolor="#88ddff"><font size="1"> Name
285
286 :</font></td>
287 <td valign="top">
288 <input size="20" TYPE="TEXT"
name="Acc_Name" id="Acc_Name">
289 </td>
290 </tr>-->
291 <tr>
292 <td align="left"
bgcolor="#88ddff"><font face="verdana, sans-serif"
color="#000066" size="2"> Type:<br>
293 <font size="1"> </font></td>
294 <td valign="top">
295 <input size="31" TYPE="TEXT"
name="Type" id="Type">
296 </td>
297 </tr>
298 <tr>
299 <td align="left"
bgcolor="#88ddff"><font face="verdana, sans-serif"
color="#000066" size="2">Number:</font></td>
300 <td valign="top">
301 <input size="31" TYPE="TEXT"
name="Number" id="Number">
302 </td>
303 </tr>
303 <!-- This is a new field. You need to fix the
code in the error notices above. The one which you
wrote, "Sorry, please enter your umber" is called if
he doesn't complete the field 'acount name'. There was
no field for number. The text you wrote above should
be used for an error notice if he doesn't fill in
number. The text you should use in the error notice
for name is: Sorry, please enter the exact name
305
306 made .-->
307 <tr>
308 <td align="left"
bgcolor="#88ddff"><font face="verdana, sans-serif"
color="#000066" size="2">Expiration Date:</font>
309 </td>
310 <td valign="top">
311 <input size="31" TYPE="TEXT"
value="mm/dd/yyyy" name="Expiry" id="Expiry">
312 </td>
313 </tr>
314 <tr>
315 <td align="left" bgcolor="#88ddff"
valign="top"><font face="verdana, sans-serif"
color="#000066" size="2">Amount:</font></td>
316 <td valign="top">
317 <input size="31" TYPE="TEXT"
NAME="Amount" id="Amount">
318 </td>
319 </tr>
320 <tr>
321 <td align="left"
bgcolor="#88ddff"><font face="verdana, sans-serif"
color="#000066" size="2">Monthly:
322 </font></td>
323 <td valign="top">
324 <input size="31" TYPE="TEXT"
value="Yes" name="Monthly" id="Monthly">
325 </td>
326 </tr>
327 <tr>
328 <!--<td align="left"
bgcolor="#88ddff">Your email address:<br>
329 <font size="1"> </font></td>
330 <td valign="top">
331 <input size="20" TYPE="TEXT"
name="email" id="email"
value="<%=request("usrname")%>">
332 </td>
333 </tr>
334 <tr>
335 <td align="left" bgcolor="#88ddff">Item
Name:<br>
336 <font size="1"> </font></td>
337 <td valign="top">
338 <%if request("cd")="y" then
339 select case ucase(request("CdLang"))
340 case "HE"
341
342 %>
343
344 <!--<INPUT TYPE="text" disabled NAME=""
VALUE="CD HEBREW">
345
346 <INPUT TYPE="hidden" NAME="item_name"
id="item_name" VALUE="CD HEBREW">
347 <INPUT TYPE="hidden" NAME="item_number"
id="item_number" VALUE="12">
348 <%
349 case "ES"
350 %>
351
352 <INPUT TYPE="text" disabled NAME="" VALUE="CD
SPANISH">
353
354 <INPUT TYPE="hidden" NAME="item_name"
id="item_name" VALUE="CD SPANISH">
355 <INPUT TYPE="hidden" NAME="item_number"
id="item_number" VALUE="13">
356
357 <%
358 end select
359
360 else%>
361 <INPUT TYPE="text" disabled NAME=""
VALUE="Course">
362 <INPUT TYPE="hidden" NAME="item_name"
id="item_name" VALUE="CD EN">
363 <INPUT TYPE="hidden" NAME="item_number"
id="item_number" VALUE="1">
364 <input TYPE="HIDDEN" NAME="Language"
id="Language" VALUE="EN">
365 <%
366 <%end if%>
367
368
369 </td>-->
370 </tr>
371 <!--
372 <tr>
373 <td align="right" bgcolor="#88ddff"
valign="top">Postal Address:<br>
374 <font size="1"></font></td>
375 <td valign="top">
376 <textarea ROWS="3" COLS="14"
NAME="Customer Address"></textarea>
377 </td>
378 </tr>-->
379 <tr>
380 <td align="center" bgcolor="#88ddff">
381 <INPUT type="button" value="Send" id=snd name=snd
LANGUAGE=javascript onclick="return snd_onclick()">
382 </td>
383 <td> </td>
384 </tr>
385 </table>
386 </form>
387 <SCRIPT LANGUAGE=javascript>
388<!--
389
390 window_onload();
391 //-->
392</SCRIPT>
393
394
395 </html>
--- "Peter Brunone (EasyListBox.com)"
<peter at easylistbox.com> wrote:
>
> You're going to need to show the whole file. It
> looks like you've got another statement (maybe a
> while loop?) further up the page that the parser
> expects to be closed.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the thelist
mailing list