473,385 Members | 1,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Beginner Problems

Hi,

This question will probably be too simplistic for all of you, but I am
trying to teach myself asp and I am having all sorts of problems. I
have a simple html form which calls process.asp on submit:

<html>
<head></head>
<body>
<form action="process.asp" method=Post>
<table cellpadding="0" cellspacing="5" align=center>
<tr>
<td width="100"><font color="#1B157F">Name:</font></font></td>
<td><input type="text" name="txtName" size="55"></td>
</tr>
</table>
<input type="submit" name="Submit" value="Submit Now">
</form>
</body>
</html>

I want my process.asp page to display the name the user entered and
then to send an email containing the information. Here is what I have
so far for the process.asp page:

<html>
<head></head>
<body>
<%
Dim strEmail

Dim strName
strName = Request.Form("txtName")
Response.Write strName

Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
MyCDONTSMail.From = "em****@yahoo.com"
MyCDONTSMail.To = "em****@yahoo.com"
MyCDONTSMail.Subject = "Get-A-Quote Request from " & strName
MyCDONTSMail.Body = MyBody
MyCDONTSMail.Send
Set MyCDONTSMail = Nothing
%>
</body>
</html>

I am not trying to get this to run on a webserver at this point. I am
just trying to get it run in a regular folder on my computer. I
thought that might be the reason why I wasn't receiving any email but
then the Response.Write doesn't work either. When I don't add the html
tags I get a message that asks if I want to save or open the
process.asp page instead of just running it.

A little help? I'm obviously missing something . . . any advice would
be greatly appreciated!

Thank you!

Joy

Jan 3 '06 #1
14 1648
Hi Joy,

No, you're off to a fine start (aside from the fact that you're using 1990s
technology...). But ASP files MUST be processed by a Web server. You can
probably run this locally on your machine. What are the answers to these
questions:

1. What operating system are you running?
2. Do you have IIS installed, do you know?

Ray at home

<si***********@yahoo.com> wrote in message
news:11********************@g14g2000cwa.googlegrou ps.com...

I am not trying to get this to run on a webserver at this point. I am
just trying to get it run in a regular folder on my computer. I
thought that might be the reason why I wasn't receiving any email but
then the Response.Write doesn't work either. When I don't add the html
tags I get a message that asks if I want to save or open the
process.asp page instead of just running it.

A little help? I'm obviously missing something . . . any advice would
be greatly appreciated!

Jan 3 '06 #2
Thanks Ray,

I do have IIS installed and I am running Windows XP. However, the
webpage will not reside on my computer however. What do I need to do?

Joy

Jan 3 '06 #3
The web page ~will~ not but currently does? That's fine. That's normal.
In a default IIS setup, your "home page" for your site should reside in
C:\Inetpub\wwwroot. Put your ASP files there and test them by going to
http://localhost/yourpagename.asp

NOW, other things:

CDONTS = CDO for NT Server. You're running Windows XP. It does not have
CDONTS. If you installed the SMTP service when you installed IIS, you'll
have CDOSYS. Read this: http://www.aspfaq.com/show.asp?id=2026 Depending
on your setup where you're working, the e-mails may not actually be sent.
Like, if you're a bank teller playing with ASP files in between customers
and you start trying to relay e-mail from your site, it probably won't go.
Instead, you may wind up getting a call from a network admin asking why your
machine is trying to relay mail. I suggest that you just stop the SMTP
service and test the success of your ASP code by verifying that the mail was
placed in C:\Inetpub\mailroot\pickup, if it turns out that you cannot relay
mail from your machine.

Ray at home

<si***********@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Thanks Ray,

I do have IIS installed and I am running Windows XP. However, the
webpage will not reside on my computer however. What do I need to do?

Joy

Jan 4 '06 #4
Thank you so much Ray, I have done as you instructed and I placed the
folder containing all my html and asp files in C:\Inetpub\wwwroot and
then I created a virtual directory in IIS that points to that folder (I
was supposed to do that right?) but when I say
http://localhost/yourpagename.asp - it says the page cannot be
displayed - do you have any idea what is wrong?

Thanks!

Joy

Jan 4 '06 #5
Ok, silly me, I just needed to add the folder name to the path -
another question - I understand why the CDONTS doesn't work but
Response.Write doesn't work at all either. Can you tell from my code
if I am doing anything wrong?

Thanks!

Joy

Jan 4 '06 #6

si***********@yahoo.com wrote:
Thank you so much Ray, I have done as you instructed and I placed the
folder containing all my html and asp files in C:\Inetpub\wwwroot and
then I created a virtual directory in IIS that points to that folder (I
was supposed to do that right?) but when I say
http://localhost/yourpagename.asp - it says the page cannot be
displayed - do you have any idea what is wrong?


If you're using IE, make sure in Internet Options that "Show Friendly
HTTP error messages" is turned OFF.

This way the browser will tell you exactly where the error is occurring
in the ASP. There could be a syntax error on line 1, and you'd never
know it.

Jan 4 '06 #7
Show us your current code that you have now, and what does "doesn't work"
mean? Do you get an error? What does it say? Do you get a blank page?

Also, did you read what I wrote about how CDONTS hasn't really been in vogue
since 1999?

Ray at home

<si***********@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Ok, silly me, I just needed to add the folder name to the path -
another question - I understand why the CDONTS doesn't work but
Response.Write doesn't work at all either. Can you tell from my code
if I am doing anything wrong?

Thanks!

Joy

Jan 4 '06 #8
Hello si***********@yahoo.com,
About the CDOSYS as Ray Costanzo [MVP] said, he is correct, but in
addition when you declare and set the variable, i noticed that you
wrote Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
Its better to write Set MyCDONTSMail =
Server.CreateObject("CDONTS.NewMail")
I know that you might say that "what did u add the server, i doesn't
make any difference" but trust me, when u program using Microsoft
programs, everything is possible. For example once i was using
MapPath("Location.mdb") and always getting an error, but couldn't find
it, then i had an idea, which was to add server to the command, so it
looked like this Server.MapPath("Locatuo.mdb"), after that the page
worked propoply with no extra problem, and by the way when u click
Ctrl+Space in Microsoft Visual InterDev you will find that MapPath
works without the Server as well as the CreateObject.
Hope this helps
Best Regards
Firas S Assaad

Jan 5 '06 #9
fi******@gmail.com wrote:
Hello si***********@yahoo.com,
About the CDOSYS as Ray Costanzo [MVP] said, he is correct, but in
addition when you declare and set the variable, i noticed that you
wrote Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
Its better to write Set MyCDONTSMail =
Server.CreateObject("CDONTS.NewMail")

In older versions of IIS, this did make a difference. In newer versions, the
recommendation is to use the vbscript version of CreateObject, rather than
the version provided by the Server object. For more information, see:

http://blogs.msdn.com/ericlippert/ar...01/145686.aspx
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jan 5 '06 #10

si***********@yahoo.com wrote:
Thank you so much Ray, I have done as you instructed and I placed the
folder containing all my html and asp files in C:\Inetpub\wwwroot and
then I created a virtual directory in IIS that points to that folder (I
was supposed to do that right?) but when I say
http://localhost/yourpagename.asp - it says the page cannot be
displayed - do you have any idea what is wrong?

Thanks!

Joy


Just a thought.... but are you actually typing
"http://localhost/yourpagename.asp" into the address bar of the
browser?

If so, you should replace "yourpagename.asp" with the name of the
directory you created, then "/" then the name of the html file you
created (with ".html" on the end).

/P.

Jan 5 '06 #11
Bob Barrows [MVP] wrote:
In older versions of IIS, this did make a difference. In newer
versions, the recommendation is to use the vbscript version of
CreateObject, rather than the version provided by the Server object.
For more information, see:
http://blogs.msdn.com/ericlippert/ar...01/145686.aspx


How on Earth do you get any recommendation out of Lippert's article?

On the contrary, one of the comments suggests that this approach voids
connection pooling, and that would certainly give me pause.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jan 5 '06 #12
Dave Anderson wrote:
Bob Barrows [MVP] wrote:
In older versions of IIS, this did make a difference. In newer
versions, the recommendation is to use the vbscript version of
CreateObject, rather than the version provided by the Server object.
For more information, see:
http://blogs.msdn.com/ericlippert/ar...01/145686.aspx
How on Earth do you get any recommendation out of Lippert's article?


Yes, you're right. My bad. Eric made no recommendations. I had a
recommendation made in a post by Egbert Nierop
(http://groups.google.com/group/micro...p.general/msg/
409380a9492fb9c8?hl=en&) in the back of my mind when I wrote the above. He
had done some testing and come to the conclusion that using the Server
version was not only unnecessary in IIS5+, but that it also impaired
performance.

Here's a another quote:

WEll, quite simple. IIS 3/4 supported transaction management COM integration
using Server.Createobject. This statement, passes the COM context from ASP
to the inner component.
As of Windows 2000, this is no longer needed because of native COM support
for transactions and context passing, and it even slows down execution. On
windows 2000, it will process exception on components, that have no thread
affinity (C++).

On the contrary, one of the comments suggests that this approach voids
connection pooling, and that would certainly give me pause.

Yes, me too. But this was not stated by Eric, and was not substantiated by
the person who brought it up.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jan 5 '06 #13
Bob Barrows [MVP] wrote:
I had a recommendation made in a post by Egbert Nierop (
http://groups.google.com/group/micro...492fb9c8?hl=en
&) in the back of my mind when I wrote the above.
Fair enough.
He had done some testing and come to the conclusion that
using the Server version was not only unnecessary in IIS5+,
but that it also impaired performance.


When I read his post, I had a reaction similar to yours below.
On the contrary, one of the comments suggests that this
approach voids connection pooling, and that would certainly
give me pause.


Yes, me too. But this was not stated by Eric, and was not
substantiated by the person who brought it up.


Like you, I would have liked something concrete. And that is why I merely
said it would give me pause. In truth, I do not feel that EITHER assertion
was backed up with substance, so neither would be likely to change my
practices.

If I thought I had a limitless number of ASP-coding days ahead of me, I
might spend some time exploring the issues in order to convince myself one
way or the other. But let's face it -- most of us will be doing less and
less with ASP in the future, so why waste the time looking for a cycle here
and there? It's not as if anyone suggested that either approach would cause
some type of cascading performance issue...

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jan 5 '06 #14
Dave Anderson wrote:
Bob Barrows [MVP] wrote:
I had a recommendation made in a post by Egbert Nierop (
http://groups.google.com/group/micro...492fb9c8?hl=en
&) in the back of my mind when I wrote the above.


Fair enough.
He had done some testing and come to the conclusion that
using the Server version was not only unnecessary in IIS5+,
but that it also impaired performance.


When I read his post, I had a reaction similar to yours below.

I suspected that would be your response, and after posting the above, tried
to find the post that really convinced me, but could not find it, so as you
say later on in your reply, it's time to move on.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jan 6 '06 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: jcnews | last post by:
I am a beginner programmer just starting to learn Java. Can someone tell me what is wrong with this applet? The output is: Circumference is 47.1225 Area is 176.70938 Volume is 1767.0938 I...
8
by: jcnews | last post by:
I am using Windows XP and am learning how to program in Java. Is there any way to get my fonts to be anti-aliased in both editors and in my programs? The non anti-aliased fonts don't look very...
2
by: Zipper | last post by:
Hello, this is my first time posting to this newsgroup, I was unable to find the FAQ for this group. I'm not sure where it's web presence is, but I was hoping someone might be able to point me in...
3
by: ·sÂA¤H | last post by:
Hi All, I am a beginner of XML, my final year project is using a XML and JAVA to develop a Workflow Management System. It make me very confuse. I don't even know how to use the XML to exchange...
44
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there...
7
by: Rensjuh | last post by:
Hello, does someone have / know a good C++ tutorial for beginnners? I would prefer Dutch, but English is also fine. Hoi, heeft / kent iemand nog een goede C++ tutorial voor beginners? Het liefste...
4
by: anonymous | last post by:
Hi Folks, I have a form with two Dropdown list boxes, which get loaded with data from Database. DropDownList1 gets data from Table1 and DropDownList2 gets data from Table2 Table1 has a...
12
by: Joshua Rulz | last post by:
Hi, i want to learn to program im quite skilled with computers and want to learn c++. is there anyone who can teach me or tell me a good website to learn it? all replies will be appreciated.
4
by: subramanian100in | last post by:
In the book, C++ Coding Standards book by Hereb Sutter and Andrei Alexandrescu, in Item 40 on pages 86-87 viz, "Avoid providing implicit conversions", the authors have advised the use of named...
22
by: ddg_linux | last post by:
I have been reading about and doing a lot of php code examples from books but now I find myself wanting to do something practical with some of the skills that I have learned. I am a beginner php...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.