![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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? |
#3
| ||||
| ||||
|
|
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. |
|
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 expressly forbidden by http? |
#4
| |||
| |||
|
|
http://127.0.0.1/ followed by the relative path to the script from your server root. |
#5
| |||
| |||
|
|
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 |
|
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. |
#6
| |||
| |||
|
|
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. |
|
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. |
#7
| |||
| |||
|
|
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? |
#8
| |||
| |||
|
|
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. |
|
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. |
#9
| |||
| |||
|
|
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. |
#10
| |||
| |||
|
|
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. |
![]() |
| Thread Tools | |
| Display Modes | |
| |