HighDots Forums  

Will this work?

alt.html alt.html


Discuss Will this work? in the alt.html forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bluuuuuue Rajah
 
Posts: n/a

Default Will this work? - 08-01-2009 , 08:02 PM






I'm teaching myself HTML forms, but I don't have a web address, so I
need to patch together an unconventional way to connect my CGI script to
my HTML form. I need to make the usual client/server exchange work with
both client and server located on the same PC.

The address of the processing agent that handles the CGI control string
is typically passed from the client to the server through the ACTION
modifier in the HTML FORM statement, with the syntax
ACTION="web_address". Since I don't have a web address, would it be
possible for me to pass a local pathname to the CGI script file that
accesses my computer's file directory?

If that were the case, my FORM command would use an ACTION statement
that looked something like ACTION="c:/dir1/dir2/.../script.exe". Will
that work?

One thing that makes me nervous is that this is supposed to be a URI,
which means that I would expect to put "http://" at the start of it.
But if I put something that starts with "http://c:/" at the start of the
pathname, that syntax doesn't look right to me. I would expect to get
some kind of run-time error, when the computer tried to parse that.

Can I pull this off, or is this way of doing things explessly forbidden
by http?

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

Default Re: Will this work? - 08-01-2009 , 08:13 PM






On Sun, 02 Aug 2009 00:02:51 +0000, Bluuuuuue Rajah wrote:

Quote:
I'm teaching myself HTML forms, but I don't have a web address, so I
need to patch together an unconventional way to connect my CGI script to
my HTML form. I need to make the usual client/server exchange work with
both client and server located on the same PC.

The address of the processing agent that handles the CGI control string
is typically passed from the client to the server through the ACTION
modifier in the HTML FORM statement, with the syntax
ACTION="web_address". Since I don't have a web address, would it be
possible for me to pass a local pathname to the CGI script file that
accesses my computer's file directory?

If that were the case, my FORM command would use an ACTION statement
that looked something like ACTION="c:/dir1/dir2/.../script.exe". Will
that work?

One thing that makes me nervous is that this is supposed to be a URI,
which means that I would expect to put "http://" at the start of it. But
if I put something that starts with "http://c:/" at the start of the
pathname, that syntax doesn't look right to me. I would expect to get
some kind of run-time error, when the computer tried to parse that.

Can I pull this off, or is this way of doing things explessly forbidden
by http?
http://127.0.0.1/ followed by the relative path to the script from your
server root.

Reply With Quote
  #3  
Old   
Scott Bryce
 
Posts: n/a

Default Re: Will this work? - 08-01-2009 , 08:20 PM



Bluuuuuue Rajah wrote:
Quote:
I'm teaching myself HTML forms, but I don't have a web address, so I
need to patch together an unconventional way to connect my CGI
script to my HTML form. I need to make the usual client/server
exchange work with both client and server located on the same PC.
In order to do this, you will need to have a server running on your
local machine. You can download Apache server, figure out how to
configure it, launch it, then send your request to localhost.

Details about how to do this are off topic in alt.html. Unfortunately,
the best newsgroup to ask this question went defunct years ago. You
could try alt.www.webmaster, or find a newsgroup that discusses Apache
server.

Quote:
If that were the case, my FORM command would use an ACTION statement
that looked something like ACTION="c:/dir1/dir2/.../script.exe".
Will that work?
The address will have to be in a form the server recognizes, not one
that your operating system recognizes. I usually use relative addresses.
This makes things simpler, but are not totally bullet proof when you
post the code, though I have never had a problem.

action='cgi-bin/myscript.exe'

Quote:
One thing that makes me nervous is that this is supposed to be a URI,
which means that I would expect to put "http://" at the start of it.
But if I put something that starts with "http://c:/" at the start of
the pathname, that syntax doesn't look right to me. I would expect
to get some kind of run-time error, when the computer tried to parse
that.
Yes, well, that is why you need a server set up on your local machine.
The server will know how to process http requests. your operating system
does not know how. And your sever will not know what c:\ means.

Quote:
Can I pull this off, or is this way of doing things expressly
forbidden by http?
You can pull this off by running a server on your local machine. Once
you have the sever set up and running, you will need to have the server,
not the operating system, serve the HTML file.

Don't load c:\mydirectory\myhtmlfile.html.

Load http://localhost/mydirectory/myhtmlfile.html.

This way the server will know how to parse the relative addresses.
Otherwise your action will have to point to a fully qualified URI.

http://localhost/mydirectory/cgi-bin/myscript.exe

That should get you pointed in the right direction.

Reply With Quote
  #4  
Old   
Scott Bryce
 
Posts: n/a

Default Re: Will this work? - 08-01-2009 , 08:26 PM



Aardvark wrote:
Quote:
http://127.0.0.1/ followed by the relative path to the script from
your server root.
Yes, but only if there is a server running at 127.0.0.1

Oh, and the relative path will be from the html file that is calling the
script, unless he is trying to call the script directly.

Reply With Quote
  #5  
Old   
Aardvark
 
Posts: n/a

Default Re: Will this work? - 08-01-2009 , 09:02 PM



On Sat, 01 Aug 2009 18:26:15 -0600, Scott Bryce wrote:

Quote:
Aardvark wrote:
http://127.0.0.1/ followed by the relative path to the script from your
server root.

Yes, but only if there is a server running at 127.0.0.1
Fuck! I made the assumption that's what he was doing. Oh, well. Don't mind
me. I'll just wander aimlessly off now.

Quote:
Oh, and the relative path will be from the html file that is calling the
script, unless he is trying to call the script directly.
I thought about it after I'd posted and thought that it would actually be
the path to the script relative to the document root, rather than server
root. It's been a while since I tinkered with the 'A' in my LAMP server.
The 'M' and the 'P' as well, for that matter.

:-)

Reply With Quote
  #6  
Old   
Scott Bryce
 
Posts: n/a

Default Re: Will this work? - 08-01-2009 , 09:37 PM



Aardvark wrote:
Quote:
On Sat, 01 Aug 2009 18:26:15 -0600, Scott Bryce wrote:
Yes, but only if there is a server running at 127.0.0.1

I made the assumption that's what he was doing.
I thought it was obvious from his question that he is not even aware
that he CAN run a server on his local machine.

Quote:
It's been a while since I tinkered with the 'A' in my LAMP server.
The 'M' and the 'P' as well, for that matter.
In my case it looks more like WAP on my local machine. But I haven't
done any configuring of the Apache server in a long time.

Reply With Quote
  #7  
Old   
Adrienne Boswell
 
Posts: n/a

Default Re: Will this work? - 08-01-2009 , 10:32 PM



Gazing into my crystal ball I observed Bluuuuuue Rajah
<Bluuuuuue (AT) Rajah (DOT) Com> writing in news:Xns9C5ACAB899B16fdgdfjhsrtg@
188.40.43.213:

Quote:
If that were the case, my FORM command would use an ACTION statement
that looked something like ACTION="c:/dir1/dir2/.../script.exe". Will
that work?

As others have said, you need to set up a server on your machine. If you
are running Windows (at least XP Pro), you can use IIS. Yes, it is
different from Apache, and does not have a lot of the great bells and
whistles, but for a testing server, s'all right.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Reply With Quote
  #8  
Old   
Aardvark
 
Posts: n/a

Default Re: Will this work? - 08-02-2009 , 09:15 AM



On Sat, 01 Aug 2009 19:37:44 -0600, Scott Bryce wrote:

Quote:
Aardvark wrote:
On Sat, 01 Aug 2009 18:26:15 -0600, Scott Bryce wrote:
Yes, but only if there is a server running at 127.0.0.1

I made the assumption that's what he was doing.

I thought it was obvious from his question that he is not even aware
that he CAN run a server on his local machine.

All I can say in my defence is that it was late and I was tired :-)

Quote:
It's been a while since I tinkered with the 'A' in my LAMP server. The
'M' and the 'P' as well, for that matter.

In my case it looks more like WAP on my local machine. But I haven't
done any configuring of the Apache server in a long time.
Yup. Get the fucker running the way you like it and then resist with all
the willpower you have any urges to tinker with the setup.

Reply With Quote
  #9  
Old   
Bluuuuuue Rajah
 
Posts: n/a

Default Re: Will this work? - 08-02-2009 , 04:56 PM



Adrienne Boswell <arbpen (AT) yahoo (DOT) com> wrote in
news:Xns9C5AC592541CFarbpenyahoocom (AT) 188 (DOT) 40.43.213:

Quote:
Gazing into my crystal ball I observed Bluuuuuue Rajah
Bluuuuuue (AT) Rajah (DOT) Com> writing in news:Xns9C5ACAB899B16fdgdfjhsrtg@
188.40.43.213:

If that were the case, my FORM command would use an ACTION statement
that looked something like ACTION="c:/dir1/dir2/.../script.exe".
Will that work?

As others have said, you need to set up a server on your machine. If
you are running Windows (at least XP Pro), you can use IIS. Yes, it
is different from Apache, and does not have a lot of the great bells
and whistles, but for a testing server, s'all right.
I'm thinking of using Apache, unless the setup procedure for IIS is much
simple than Apache. Is that the case?

Reply With Quote
  #10  
Old   
Bluuuuuue Rajah
 
Posts: n/a

Default Re: Will this work? - 08-02-2009 , 05:01 PM



Scott Bryce <sbryce (AT) scottbryce (DOT) com> wrote in
news:h52m6v$t0u$1 (AT) news (DOT) eternal-september.org:

Quote:
Bluuuuuue Rajah wrote:
I'm teaching myself HTML forms, but I don't have a web address, so I
need to patch together an unconventional way to connect my CGI
script to my HTML form. I need to make the usual client/server
exchange work with both client and server located on the same PC.

In order to do this, you will need to have a server running on your
local machine. You can download Apache server, figure out how to
configure it, launch it, then send your request to localhost.

Details about how to do this are off topic in alt.html. Unfortunately,
the best newsgroup to ask this question went defunct years ago. You
could try alt.www.webmaster, or find a newsgroup that discusses Apache
server.

If that were the case, my FORM command would use an ACTION statement
that looked something like ACTION="c:/dir1/dir2/.../script.exe".
Will that work?

The address will have to be in a form the server recognizes, not one
that your operating system recognizes. I usually use relative
addresses. This makes things simpler, but are not totally bullet proof
when you post the code, though I have never had a problem.

action='cgi-bin/myscript.exe'

One thing that makes me nervous is that this is supposed to be a URI,
which means that I would expect to put "http://" at the start of it.
But if I put something that starts with "http://c:/" at the start of
the pathname, that syntax doesn't look right to me. I would expect
to get some kind of run-time error, when the computer tried to parse
that.

Yes, well, that is why you need a server set up on your local machine.
The server will know how to process http requests. your operating
system does not know how. And your sever will not know what c:\ means.

Can I pull this off, or is this way of doing things expressly
forbidden by http?

You can pull this off by running a server on your local machine. Once
you have the sever set up and running, you will need to have the
server, not the operating system, serve the HTML file.

Don't load c:\mydirectory\myhtmlfile.html.

Load http://localhost/mydirectory/myhtmlfile.html.

This way the server will know how to parse the relative addresses.
Otherwise your action will have to point to a fully qualified URI.

http://localhost/mydirectory/cgi-bin/myscript.exe

That should get you pointed in the right direction.
Thanks for all the useful suggestions. I looked for the Windows XP
version at apache.org and found a file called "apache_2.2.11-win32-x86-
no_ssl.msi". Is that the one I want?

I was expecting an .exe file and have never heard of an .msi file, but
that seems to stand for "microsoft install." Am I right about that?

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 - 2009, Jelsoft Enterprises Ltd.