Newbie stuck posting to an ASP page

  • Thread starter as mellow as a horse
  • Start date
A

as mellow as a horse

I'm currently learning asp using IIS 5 (or is it 5.1?) on a standalone
windows xp machine. I wrote some html code with a form that posted to an
asp file.

After much head-scratching I found out that rather than simply write
something like

<form action="page.asp" ...>

as I would with an html file. I had to fully qualify the location of the
asp file like:

<form action="http:\\my_pc\page.asp" ... >

Is this right? I've looked at how it's done on other web pages and they
don't have to do anything like this, they just do what I did in the first
line of code. I don't yet have anywhere to put my pages apart from my local
machine, but it'll be a nuisance if I have to use refs like
"http:\\my_pc\page.asp" and then change them all to simply "page.asp"
 
M

mscir

as said:
I'm currently learning asp using IIS 5 (or is it 5.1?) on a standalone
windows xp machine. I wrote some html code with a form that posted to an
asp file.

After much head-scratching I found out that rather than simply write
something like

<form action="page.asp" ...>

as I would with an html file. I had to fully qualify the location of the
asp file like:

<form action="http:\\my_pc\page.asp" ... >

Is this right? I've looked at how it's done on other web pages and they
don't have to do anything like this, they just do what I did in the first
line of code. I don't yet have anywhere to put my pages apart from my local
machine, but it'll be a nuisance if I have to use refs like
"http:\\my_pc\page.asp" and then change them all to simply "page.asp"

This site says a general guideline is:

http://webtips.dan.info/url.html

TIP: Use absolute URLs when linking to a different site, and relative
URLs when linking within your site.

Are you saying that your form didn't submit correctly when you used a
relative url action="page.asp"? Are the forms page and page.asp in the
saem folder?

Mike
 
A

Augustus

as mellow as a horse said:
I'm currently learning asp using IIS 5 (or is it 5.1?) on a standalone
windows xp machine. I wrote some html code with a form that posted to an
asp file.

After much head-scratching I found out that rather than simply write
something like

<form action="page.asp" ...>

as I would with an html file. I had to fully qualify the location of the
asp file like:

<form action="http:\\my_pc\page.asp" ... >

Is this right? I've looked at how it's done on other web pages and they
don't have to do anything like this, they just do what I did in the first
line of code. I don't yet have anywhere to put my pages apart from my local
machine, but it'll be a nuisance if I have to use refs like
"http:\\my_pc\page.asp" and then change them all to simply "page.asp"

ASP pages only run if they are hosted by IIS and accessed through it

So though you can have a folder called "my development folder" on your
desktop and can write and view your HTML files in it, you cannot do this
with ASP

It sounds like you have the ASP part of it right... that you are refering to
the page as "http:\\my_pc\page.asp"

What you need to do now is copy the HTML files to your server space as well
(this is most likely: C:\inetpub\wwwroot but you can set it to any
folder you want on your computer)

If you do that then to access your HTML file you would view it through IIS
as well, by entering in the URL bar of your browser:
http://localhost/myfile.html

The "http://localhost/" part means you are viewing it not as a file on your
computer (as you would be if you just double clicked on an HTML file on your
desktop), but as a web page served by IIS

You can find more information at:
http://www.w3schools.com/asp/asp_install.asp
 
T

Toby A Inkster

as said:
After much head-scratching I found out that rather than simply write
something like <form action="page.asp" ...> as I would with an html
file. I had to fully qualify the location of the asp file like:
<form action="http:\\my_pc\page.asp" ... >

Make sure that you've viewing the page with the form (as against the page
with the form *handler*) through IIS, and not directly on your hard disk.
 
H

Hywel Jenkins

as mellow as a horse said:
I'm currently learning asp using IIS 5 (or is it 5.1?) on a standalone
windows xp machine. I wrote some html code with a form that posted to an
asp file.

After much head-scratching I found out that rather than simply write
something like

<form action="page.asp" ...>

as I would with an html file. I had to fully qualify the location of the
asp file like:

<form action="http:\\my_pc\page.asp" ... >

Is this right? I've looked at how it's done on other web pages and they
don't have to do anything like this, they just do what I did in the first
line of code. I don't yet have anywhere to put my pages apart from my local
machine, but it'll be a nuisance if I have to use refs like
"http:\\my_pc\page.asp" and then change them all to simply "page.asp"

Although quite long, your post hasn't detailed what happens when you
use the first method. Do you get a server error? Does the ASP just
get rendered to the browser? Is IIS actually configured to run ASP in
the folder you're using?

Either method works - you don't need to fully qualify the URL to get
ASP form submissions to work. However, the URL in your second example
is incorrect:
http://my_pc/page.asp
 
A

as mellow as a horse

as mellow as a horse said:
I'm currently learning asp using IIS 5 (or is it 5.1?) on a standalone
windows xp machine. I wrote some html code with a form that posted to an
asp file.

After much head-scratching I found out that rather than simply write
something like

<form action="page.asp" ...>

as I would with an html file. I had to fully qualify the location of the
asp file like:

<form action="http:\\my_pc\page.asp" ... >

Is this right? I've looked at how it's done on other web pages and they
don't have to do anything like this, they just do what I did in the first
line of code. I don't yet have anywhere to put my pages apart from my local
machine, but it'll be a nuisance if I have to use refs like
"http:\\my_pc\page.asp" and then change them all to simply "page.asp"

Sorry to confuse some of you with some points.

*ALL* of the pages are in C:\inetpub\wwwroot. This is the root directory as
used by IIS as when I just type http:\\localhost, it redirects to
localstart.asp as I haven't yet got a default page of my own as I'm only new
to ASP and IIS.

Where I've put "http:\\my_pc\page.asp", "my_pc" is literally the name of my
pc, so you could substitute "http:\\localhost\page.asp" to the same effect.

I got my "//" and "\\" mixed up in the OP as I had to type it in asI'm using
frontpage, and when I tried to copy and paste to do this post, it came out
as html.

What happens when I just use "form action= page.asp" instead of "form action
= http:\\my_pc\page.asp" is that Win XP puts up a 'download file' requestor
as if I'd put "form action= XXX.exe" or something.

And as I'm linking from one file in C:\inetpub\wwwroot to another in the
same directory, a relative URL should work, surely?
 
A

as mellow as a horse

I've just restarted windows and it works now for some reason! Thanks for
your replies anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top