Newbie stuck posting to an ASP page

Discussion in 'HTML' started by as mellow as a horse, May 10, 2004.

  1. 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"
    as mellow as a horse, May 10, 2004
    #1
    1. Advertising

  2. as mellow as a horse

    mscir Guest

    as mellow as a horse wrote:

    > 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
    mscir, May 10, 2004
    #2
    1. Advertising

  3. as mellow as a horse

    Augustus Guest

    "as mellow as a horse" <> wrote in message
    news:c7mi6e$8ot$...
    > 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
    Augustus, May 10, 2004
    #3
  4. as mellow as a horse wrote:

    > 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
    Toby A Inkster, May 10, 2004
    #4
  5. "as mellow as a horse" <> wrote in message news:<c7mi6e$8ot$>...
    > 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
    Hywel Jenkins, May 10, 2004
    #5
  6. "as mellow as a horse" <> wrote in message
    news:c7mi6e$8ot$...
    > 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?
    as mellow as a horse, May 10, 2004
    #6
  7. I've just restarted windows and it works now for some reason! Thanks for
    your replies anyway.

    "as mellow as a horse" <> wrote in message
    news:c7o1ho$a40$...
    > "as mellow as a horse" <> wrote in message
    > news:c7mi6e$8ot$...
    > > 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?
    >
    >
    as mellow as a horse, May 10, 2004
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. alanb
    Replies:
    2
    Views:
    517
    alanb
    Apr 23, 2004
  2. Mike Silva

    Stuck newbie

    Mike Silva, Dec 2, 2003, in forum: Python
    Replies:
    4
    Views:
    341
  3. AmitKu
    Replies:
    7
    Views:
    482
    John Timney \(MVP\)
    Jan 8, 2007
  4. Newbie - Stuck

    , Oct 8, 2006, in forum: Python
    Replies:
    8
    Views:
    343
    Theerasak Photha
    Oct 10, 2006
  5. Sheetal
    Replies:
    3
    Views:
    766
Loading...

Share This Page