![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
Scott Bryce <sbryce (AT) scottbryce (DOT) com> wrote in news:h52m6v$t0u$1 (AT) news (DOT) eternal-september.org: 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? |
#12
| |||
| |||
|
|
Adrienne Boswell <arbpen (AT) yahoo (DOT) com> wrote in news:Xns9C5AC592541CFarbpenyahoocom (AT) 188 (DOT) 40.43.213: 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? |
#13
| |||
| |||
|
|
It wouldn't be a bad idea to set up an ftp server as well in order to more easily upload web pages and scripts to the Apache server. |
#14
| |||
| |||
|
|
I'm thinking of using Apache, unless the setup procedure for IIS is much simple than Apache. Is that the case? |
#15
| |||
| |||
|
|
Or are you talking about using a local FTP server to transfer files to the web server? I just use an FTP program to do that. |
#16
| |||
| |||
|
|
Aardvark wrote: It wouldn't be a bad idea to set up an ftp server as well in order to more easily upload web pages and scripts to the Apache server. Why? The files on his local machine are already on his local machine. |
|
All he has to do is set up an alias and/or script alias in the config file. |
|
Or are you talking about using a local FTP server to transfer files to the web server? I just use an FTP program to do that. |
#17
| |||
| |||
|
|
Aardvark <aardvark (AT) youllnever (DOT) know> wrote fire your Apache up, point your browser to 127.0.0.1 How come you guys keep mentioning 127.0.0.1? Is that address special in some way? |
#18
| ||||
| ||||
|
|
On Sun, 02 Aug 2009 21:01:05 +0000, Bluuuuuue Rajah wrote: Scott Bryce <sbryce (AT) scottbryce (DOT) com> wrote in news:h52m6v$t0u$1 (AT) news (DOT) eternal-september.org: 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? It is, although I think there's also a version with ssl if you need it. |

|
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? Once again, spot on. Download, double-click and install. During the install you'll be asked to enter a few elementary configurations, but once it's done, you should be able to ... |
|
fire your Apache up, point your browser to 127.0.0.1 |
|
and hey presto, there's the default index page on your very own server. It wouldn't be a bad idea to set up an ftp server as well in order to more easily upload web pages and scripts to the Apache server. |
#19
| ||||
| ||||
|
|
Once again, spot on. Download, double-click and install. During the install you'll be asked to enter a few elementary configurations, but once it's done, you should be able to ... Thanks. I'll walk through the setup and see if there's anything I don't understand. When the .msi file unpackages itself, will I find a document in there telling me how to decide on the various choices I'll be asked to make? |
|
Also, how do I test that it's working, once the install is done? I don't want to test it by writing a page that asks the server to send "Hello World" when I click "Submit," because I've never done that before either, so I have to test the two separately. You can't test two things that you've never done at the same time, because when it doesn't work, you don't know which stage is broken. |
|
fire your Apache up, point your browser to 127.0.0.1 How come you guys keep mentioning 127.0.0.1? Is that address special in some way? |
|
and hey presto, there's the default index page on your very own server. It wouldn't be a bad idea to set up an ftp server as well in order to more easily upload web pages and scripts to the Apache server. I don't think I will. One of the headaches that I've bought myself with install is the need to teach myself about website security, so that people don't hack me. I really don't have the time for that, so for now, my plan is to just keep the server turned off when I'm not programming a |
#20
| |||
| |||
|
|
On Sun, 02 Aug 2009 15:51:47 -0600, Scott Bryce wrote: All he has to do is set up an alias and/or script alias in the config file. Or keep his document root folder open while he's working on pages and scripts. More than one way to skin a cat. |
![]() |
| Thread Tools | |
| Display Modes | |
| |