Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - what is wrong with this asp-page?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

what is wrong with this asp-page?

 Post Reply Post Reply
Author
eagle00789 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 24 March 2003
Location: Netherlands
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote eagle00789 Quote  Post ReplyReply Direct Link To This Post Topic: what is wrong with this asp-page?
    Posted: 08 April 2003 at 2:12am

what is wrong with the below asp-page. if i neter a wrong verificationcode it still sends the e-mail.

----- begin op ziekmelding.asp -----

<html>
<head>
<title>CDONTS Test</title>
<!--mstheme--><link rel="stylesheet" type="text/css" href="_themes/kids/kids1111.css"><meta name="Microsoft Theme" content="kids 1111">
<script language="JavaScript">
<!-- Hide from older browsers...

//Function to check form is filled in correctly before submitting
function CheckForm () {

 //Check for a valid code
 if (document.frmNewForum.Verify.value==document.frmNewForum.Code.value){
  alert("Please enter a valid code");
  return false;
 }
 
 return true
}
// -->
</script>
</head>
<body onload="javascript:{if(parent.frames[0]&&parent.frames['menu'].Go)parent.frames['menu'].Go()}">
<center>
<table width="500">

<%
If request.form("action")="Verstuur" then
    on error resume next
    Set Mail = CreateObject("CDONTS.Newmail")
    if err.number = 0 then
        Mail.From = "Gravenrode Website<webmaster@gravenrode.nl>"
        Mail.To = request.form("Locatie")
        Mail.Subject = "Ziekmelding"
        Mail.BodyFormat = 0
        Mail.MailFormat = 0
        HTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & vbCrLf
        HTML = HTML & "<html>" & vbCrLf
        HTML = HTML & "<head>" & vbCrLf
        HTML = HTML & "<meta http-equiv=""Content-Type"" content=""text/html; charset=iso-8859-1"">" & vbCrLf
        HTML = HTML & "<title>Ziekmelding</title>" & vbCrLf
        HTML = HTML & "</head>" & vbCrLf
        HTML = HTML & "<body>" & vbCrLf
        HTML = HTML & "<h1>Ziekmelding</h1>" & vbCrLf
        HTML = HTML & "Via de website is <b>" + request.form("Naam") + "</b> ziekgemeld geworden.<br>" & vbCrLf
        HTML = HTML & "Hij/Zij zit in groep <b>" + request.form("Groep") + "</b>." & vbCrLf
        HTML = HTML & "</body>" & vbCrLf
        HTML = HTML & "</html>"
        Mail.Body = HTML
        Mail.Importance = 2
        Mail.Send
        Set Mail = Nothing
%>
<tr>
  <td align="center">
  <b>Ziekemelding</b>
  <p>Uw ziekmelding is verstuurd.
  <% else %>
  <td align="center">
  <font face="arial">
  <h3>Test Completed</h3>
  <p>Er is een onbekende fout opgetreden.
  <% end if %>
  </td>
</tr>

<% Else %>
<tr>
  <td align="center">
    <font face="times new roman">
    <h2 align="center"><i>Ziekmelding</i></h2></font>
    <font face="Arial">
    <form action="ziekmelding.asp" method="POST" onSubmit="return CheckForm();">
    <p align="center">U kunt door middel van het formulier hieronder uw kind ziekmelden<br>
    <div align="center">
      <center><pre>De naam van uw kind: <input type="text" name="Naam" size="20">
      De groep van uw kind:<select name="Groep" size="1" width="25">
<option selected>Selecteer de groep van uw kind</option>
<option value="1/2a">Groep 1/2a</option>
<option value="1/2b">Groep 1/2b</option>
<option value="1/2c">Groep 1/2c</option>
<option value="3.0">Groep 3.0</option>
<option value="3.1/4.1">Groep 3.1/4.1</option>
<option value="4.0">Groep 4.0</option>
<option value="5.0/6.0">Groep 5.0/6.0</option>
<option value="5.1/6.1">Groep 5.1/6.1</option>
<option value="6.01/7.0">Groep 6.01/7.0</option>
<option value="7.1">Groep 7.1</option>
<option value="8.0">Groep 8.0</option>
<option value="8.1">Groep 8.1</option>
</select>
      De locatie van uw kind:<select name="Locatie" size="1" width="25">
<option selected>Selecteer de locatie van uw kind</option>
<option value="c.simon@gravenrode.nl">Locatie Achter de Winkel</option>
<option value="c.simon@gravenrode.nl">Locatie De Wendel</option>
</select>
    Verificatiecode: <input type="integer" name="Verify" size="20"><br>
    Type de onderstaande code in het vak hierboven:<br>
<%
Randomize()
Code = rnd()
response.write (right(round(Code,6),6))
%>
    </pre>
      </center>
    </div>
    <p align="center"><center>
    <input type="hidden" name="Code" Value=Code>
    <input type="SUBMIT" name="action" value="Verstuur">
    <input type="RESET" value="Wissen"></center></form></font>
    </td>
<% End If %>
</table>
</body>
</html>

----- end ziekmelding.asp -----

Using forum at Gravenrode and here and here
Back to Top
ultramods View Drop Down
Groupie
Groupie
Avatar

Joined: 08 January 2003
Location: Scotland
Status: Offline
Points: 146
Post Options Post Options   Thanks (0) Thanks(0)   Quote ultramods Quote  Post ReplyReply Direct Link To This Post Posted: 08 April 2003 at 4:54am

I have found a couple of things. You didnt name your form so that function checkform couldnt see the form objects.

<form name=frmNewForum action="ziekmelding.asp"

Also

it shoud be an error if Verify isnt equal to Code, so use !

if (document.frmNewForum.Verify.value !==document.frmNewForum.Code.value).

Hope that helps.

Back to Top
eagle00789 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 24 March 2003
Location: Netherlands
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote eagle00789 Quote  Post ReplyReply Direct Link To This Post Posted: 08 April 2003 at 5:10am
it works partially. i now do get a message when i enter an incorrect code, but if i enter a correct code it also gives me the same message
Using forum at Gravenrode and here and here
Back to Top
ultramods View Drop Down
Groupie
Groupie
Avatar

Joined: 08 January 2003
Location: Scotland
Status: Offline
Points: 146
Post Options Post Options   Thanks (0) Thanks(0)   Quote ultramods Quote  Post ReplyReply Direct Link To This Post Posted: 08 April 2003 at 5:16am
Can you show me your new code please as i tested it, and it all worked fine.
Back to Top
ultramods View Drop Down
Groupie
Groupie
Avatar

Joined: 08 January 2003
Location: Scotland
Status: Offline
Points: 146
Post Options Post Options   Thanks (0) Thanks(0)   Quote ultramods Quote  Post ReplyReply Direct Link To This Post Posted: 08 April 2003 at 5:19am

Sorry i forgot to add the final part.

<input type="hidden" name="Code" Value=<%=right(round(Code,6),6)%>>

Back to Top
eagle00789 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 24 March 2003
Location: Netherlands
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote eagle00789 Quote  Post ReplyReply Direct Link To This Post Posted: 08 April 2003 at 5:24am

that just made it work like it should. but for the record, hee is my code as i have it now:

----- begin of ziekmelding.asp -----
<html>
<head>
<title>CDONTS Test</title>
<!--mstheme--><link rel="stylesheet" type="text/css" href="_themes/kids/kids1111.css"><meta name="Microsoft Theme" content="kids 1111">
<script language="JavaScript">
<!-- Hide from older browsers...

//Function to check form is filled in correctly before submitting
function CheckForm () {

 //Check for a valid code
 if (document.frmNewForum.Verify.value!==document.frmNewForum.Code.value){
  alert("Please enter a valid code");
  return false;
 }
 
 return true
}
// -->
</script>
</head>
<body onload="javascript:{if(parent.frames[0]&&parent.frames['menu'].Go)parent.frames['menu'].Go()}">
<center>
<table width="500">

<%
If request.form("action")="Verstuur" then
    on error resume next
    Set Mail = CreateObject("CDONTS.Newmail")
    if err.number = 0 then
        Mail.From = "Gravenrode Website<webmaster@gravenrode.nl>"
        Mail.To = request.form("Locatie")
        Mail.Subject = "Ziekmelding"
        Mail.BodyFormat = 0
        Mail.MailFormat = 0
        HTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & vbCrLf
        HTML = HTML & "<html>" & vbCrLf
        HTML = HTML & "<head>" & vbCrLf
        HTML = HTML & "<meta http-equiv=""Content-Type"" content=""text/html; charset=iso-8859-1"">" & vbCrLf
        HTML = HTML & "<title>Ziekmelding</title>" & vbCrLf
        HTML = HTML & "</head>" & vbCrLf
        HTML = HTML & "<body>" & vbCrLf
        HTML = HTML & "<h1>Ziekmelding</h1>" & vbCrLf
        HTML = HTML & "Via de website is <b>" + request.form("Naam") + "</b> ziekgemeld geworden.<br>" & vbCrLf
        HTML = HTML & "Hij/Zij zit in groep <b>" + request.form("Groep") + "</b>." & vbCrLf
        HTML = HTML & "</body>" & vbCrLf
        HTML = HTML & "</html>"
        Mail.Body = HTML
        Mail.Importance = 2
        Mail.Send
        Set Mail = Nothing
%>
<tr>
  <td align="center">
  <b>Ziekemelding</b>
  <p>Uw ziekmelding is verstuurd.
  <% else %>
  <td align="center">
  <font face="arial">
  <h3>Test Completed</h3>
  <p>Er is een onbekende fout opgetreden.
  <% end if %>
  </td>
</tr>

<% Else %>
<tr>
  <td align="center">
    <font face="times new roman">
    <h2 align="center"><i>Ziekmelding</i></h2></font>
    <font face="Arial">
    <form Name=frmNewForum action="ziekmelding.asp" method="POST" onSubmit="return CheckForm();">
    <p align="center">U kunt door middel van het formulier hieronder uw kind ziekmelden<br>
    <div align="center">
      <center><pre>De naam van uw kind: <input type="text" name="Naam" size="20">
      De groep van uw kind:<select name="Groep" size="1" width="25">
<option selected>Selecteer de groep van uw kind</option>
<option value="1/2a">Groep 1/2a</option>
<option value="1/2b">Groep 1/2b</option>
<option value="1/2c">Groep 1/2c</option>
<option value="3.0">Groep 3.0</option>
<option value="3.1/4.1">Groep 3.1/4.1</option>
<option value="4.0">Groep 4.0</option>
<option value="5.0/6.0">Groep 5.0/6.0</option>
<option value="5.1/6.1">Groep 5.1/6.1</option>
<option value="6.01/7.0">Groep 6.01/7.0</option>
<option value="7.1">Groep 7.1</option>
<option value="8.0">Groep 8.0</option>
<option value="8.1">Groep 8.1</option>
</select>
      De locatie van uw kind:<select name="Locatie" size="1" width="25">
<option selected>Selecteer de locatie van uw kind</option>
<option value="c.simon@gravenrode.nl">Locatie Achter de Winkel</option>
<option value="c.simon@gravenrode.nl">Locatie De Wendel</option>
</select>
    Verificatiecode: <input type="integer" name="Verify" size="20"><br>
    Type de onderstaande code in het vak hierboven:<br>
<%
Randomize()
tmp = rnd()
Code = right(round(tmp,6),6)
response.write (Code)
%>
    </pre>
      </center>
    </div>
    <p align="center"><center>
    <input type="hidden" name="Code" Value="<% = Code %>">
    <input type="SUBMIT" name="action" value="Verstuur">
    <input type="RESET" value="Wissen"></center></form></font>
    </td>
<% End If %>
<%
set Code = Nothing
%>
</table>
</body>
</html>
----- end of ziekmelding.asp -----

Using forum at Gravenrode and here and here
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.