[web] Need some help!

Started by
5 comments, last by Sander 16 years, 7 months ago
I need to take care of something for my work, but I don't really understand it. The thing I'm going to write here now is messy and so, but I need to change it into something working.. The thing needs to accept people into their mailing list, so people can get the mailings they sent to everyone.

<html>


<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-store">

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<!--mstheme--><link rel="stylesheet" type="text/css" href="_themes/journal/jour1000.css"><meta name="Microsoft Theme" content="journal 1000, default">
</head>
<script language="JavaScript">

<!--

function isEmail(str) {
  // are regular expressions supported?
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported) 
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
  return (!r1.test(str) && r2.test(str));
}
//-->
</script>
<SCRIPT LANGUAGE="JavaScript">
<!--

function valid(form) {
  var field = form.EmailAdress; // email field
  var str = field.value; // email string
  var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
  var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
  if (!reg1.test(str) && reg2.test(str)) { // if syntax is valid
   // alert("Thank your for your feedback."); // this is optional
    return true;
  }
  alert("Uw e-mail adres is onjuist gespeld!"); // this is also optional
  field.focus();
  field.select();
  return false;
}

// -->
</SCRIPT>

<body style="letter-spacing: 0pt; line-height: 100%; margin-top: 0">
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Op deze pagina kunt U zich 
aanmelden voor het ontvangen</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; van mailings aangaande 
evenementen in onze zaak.</p>
<p>&nbsp;</p>
<form method="POST" name="mailing request" action="handlemail.asp" onSubmit="return valid(this)">  &nbsp;<p>&nbsp;&nbsp;<span style="vertical-align: bottom">
	</span></p>
	<div style="position: absolute; width: 90px; height: 54px; z-index: 4; left: 33px; top: 169px" id="layer4">
		<span style="vertical-align: bottom"> <font size="4">Naam&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	</font></span>
	<p><span style="vertical-align: bottom"><font size="4">Adres</font></span></p>
	</div>
	<p><span style="vertical-align: bottom"><font size="4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span></p>
	<p><span style="vertical-align: bottom"><font size="4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	</font></span></p>
	<p><span style="vertical-align: bottom"><font size="4">&nbsp;&nbsp;</font></span></p>
	<div style="position: absolute; width: 100px; height: 60px; z-index: 3; left: 31px; top: 253px" id="layer3">
		<span style="vertical-align: bottom"><font size="4">Postcode.Plaats</font></span><p>
		<font size="4"><span style="vertical-align: bottom">Email</span></font></div>
	<p><font size="4"><span style="vertical-align: bottom">&nbsp;&nbsp;</span>&nbsp; </font></p>
	<p><font size="4">&nbsp;</font></p>
	<p>&nbsp;</p>
	<div style="position: absolute; width: 462px; height: 157px; z-index: 1; left: 206px; top: 165px" id="layer1">
		<font size="3"><input type="text" name="naam" size="50" tabindex="1"></font><p>
		<font size="3"><input type="text" name="Adres" size="50" tabindex="2"></font></p>
		<p><font size="3">
		<input type="text" name="postcode" size="6" tabindex="3"></font>
		<font size="3"><input type="text" name="Plaats" size="40" tabindex="4"></font></p>
		<p><font size="3">
		<input type="text" name="EmailAdress" size="50" tabindex="5"></font></p>
		<p>&nbsp;</div>
	<p>&nbsp;</p>
	<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<input type="submit" value="Verstuur" name="B1">&nbsp;
	<input type="reset" value="Opnieuw" name="B2"></p>
	<input type="hidden" name="_mailfrom" value="info@swartsenborgh.nl">
	<!-- DIT IS HET INFO ADRESS OP DE WEBSERVER -->
</form>
<p>&nbsp; </p>
<p>&nbsp;</p>
&nbsp;</body>

</html>


This is the first part, this part should be the form I guess, now the second part, which is:


<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-store">
<title>messagehandler</title>
<!--mstheme--><link rel="stylesheet" type="text/css" href="_themes/journal/jour1000.css"><meta name="Microsoft Theme" content="journal 1000, default">
</head>


<%
on error resume next
Set Mailer = Server.CreateObject("CDONTS.NewMail")

MailTo = request("EmailAdress")  
MailFrom = request("_mailfrom")      
Subject = "Mailing Request Swartsenborgh Interieurverzorging"


Message = "Dank U voor Uw interesse in onze mailings" & vbcrlf & vbcrlf 
Message = Message & vbcrlf & "om deze aanmelding te cancelen schrijf naar info@swartsenborgh.nl"
Message = Message & vbcrlf & vbcrlf & "(aanmelding gedaan vanuit www.swartsenborgh.nl)"


Mailer.From = MailFrom
Mailer.To = MailTo
Mailer.Subject = Subject
Mailer.Body = Message
Mailer.Send


Set Mailer = nothing
Message = ""

Set Mailer = Server.CreateObject("CDONTS.NewMail")
MailTo2 = request("_mailfrom")   
Subject = "Mailing Request"

for each whatever in request.form
  Message = Message & whatever & "=" 
  Message = Message & request.form(whatever) & vbcrlf 
next


Mailer.From = Mailfrom2
Mailer.To = Mailfrom2
Mailer.Subject = Subject
Mailer.Body = Message
Mailer.Send

Set Mailer = nothing

Set Mailer = nothing
Message = ""

Set Mailer = Server.CreateObject("CDONTS.NewMail")
Mail = "e.f.hobbel@wanadoo.nl" 

Subject = "Mailing Request"

for each whatever in request.form
  Message = Message & whatever & "=" 
  Message = Message & request.form(whatever) & vbcrlf 
next


Mailer.From = Mail
Mailer.To = Mail
Mailer.Subject = Subject
Mailer.Body = Message
Mailer.Send

Set Mailer = nothing


respons = "bedankt.htm?" & Mailto
response.redirect respons
%>

<body> 
<p><a href="winkel.htm">Onze excuses, er gaat iets mis met het versturen.</a>
<!--TABLE STYLE="filter:glow(color=red, strength=0)"> <TR><TD><center> <p><a href="winkel.htm">Onze excuses, er gaat iets mis met het versturen.</a></TABLE--> 

</p>

</body>


</html>


I'm not sure what this thing does. I got some questions: 1. What language is this written in? 2. What do these 2 things have to do with each other? 3. What errors could be causing this thing not work. 4. When all the bugs are out of it, what should I do with it to get it properly working on my web site? Thanks! [Edited by - Marly on September 19, 2007 3:24:48 AM]
Advertisement
1. What language is this written in?
Most of the keywords are written in English and some dutch words are in it

2. What do these 2 things have to do with each other?
The first part is used to cook some food. second is most likely going to eat it :o

3. What errors could be causing this thing not work.
Not using some Code tags :o and forgetting to bake with butter

4. When all the bugs are out of it, what should I do with it to get it properly working on my web site?
Check if you have the ingredients everyday uploaded to the website

Thanks!
np :)
Come on Loel, everyone knows that is a distributed modular checksum recomposer.(Duh).

It looks like your ray packers are off, try checking the bit alignment, that should get it working. :D
@Marly: Please edit your post and wrap your code in [source][/source] tags. The forum is eating your code.

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

Done! Could anybody answer my questions now?
This would be ASP with VBScript.

As for the rest of it, debugging web scripting code is extremely difficult without setting up a new virtual directory and actually running it, seeing it in action, seeing the program flow, and seeing the error messages.

[Formerly "capn_midnight". See some of my projects. Find me on twitter tumblr G+ Github.]

Quote:What do these 2 things have to do with each other?


The first part displays and validates a feedback form. The second part takes the form, sends an e-mail and prints a "thank you" note.

Quote:What errors could be causing this thing not work.


About a gazillion different things, really.

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

This topic is closed to new replies.

Advertisement