HighDots Forums  

Newbie stuck posting to an ASP page

alt.html alt.html


Discuss Newbie stuck posting to an ASP page in the alt.html forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
as mellow as a horse
 
Posts: n/a

Default Newbie stuck posting to an ASP page - 05-09-2004 , 08:25 PM






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"



Reply With Quote
  #2  
Old   
mscir
 
Posts: n/a

Default Re: Newbie stuck posting to an ASP page - 05-09-2004 , 09:08 PM






as mellow as a horse wrote:

Quote:
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



Reply With Quote
  #3  
Old   
Augustus
 
Posts: n/a

Default Re: Newbie stuck posting to an ASP page - 05-09-2004 , 09:19 PM




"as mellow as a horse" <mail (AT) MICKmoss42 (DOT) fslife.co.uk> wrote

Quote:
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





Reply With Quote
  #4  
Old   
Toby A Inkster
 
Posts: n/a

Default Re: Newbie stuck posting to an ASP page - 05-10-2004 , 02:31 AM



as mellow as a horse wrote:

Quote:
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.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132



Reply With Quote
  #5  
Old   
Hywel Jenkins
 
Posts: n/a

Default Re: Newbie stuck posting to an ASP page - 05-10-2004 , 03:35 AM



"as mellow as a horse" <mail (AT) MICKmoss42 (DOT) fslife.co.uk> wrote

Quote:
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

--
Hywel


Reply With Quote
  #6  
Old   
as mellow as a horse
 
Posts: n/a

Default Re: Newbie stuck posting to an ASP page - 05-10-2004 , 09:54 AM



"as mellow as a horse" <mail (AT) MICKmoss42 (DOT) fslife.co.uk> wrote

Quote:
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?




Reply With Quote
  #7  
Old   
as mellow as a horse
 
Posts: n/a

Default Re: Newbie stuck posting to an ASP page - 05-10-2004 , 03:35 PM



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

"as mellow as a horse" <mail (AT) MICKmoss42 (DOT) fslife.co.uk> wrote

Quote:
"as mellow as a horse" <mail (AT) MICKmoss42 (DOT) fslife.co.uk> wrote in message
news:c7mi6e$8ot$1 (AT) newsg3 (DOT) svr.pol.co.uk...
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?





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.