Click here to Skip to main content
15,887,776 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a tiny server program in Go language (main2.go) running and 'listening' on port 8080 in a Windows command prompt session. While running I point a browser to http://localhost:8080/main2.go and main2.go executes and places a small html form into the browser window to fill and submit. If the form ACTION has any requested target for some other Go program or HTML element resident in the same Windows folder as main2.go, the element request is ignored .... ONLY 'main2.go' gets triggered to execute instead in response to the POST request 'submitted'.

I have tried all variations I can think of in the POST ACTION URL format to get the POST to run an element in the Windows folder called 'main.go' (instead of main2.go):

ACTION examples:
http://localhost:8080/main.go
localhost:8080/main.go
/main.go
../main.go

BUT, if I load the ACTION URL with something like 'https://www.google.com' it brings the home page for Google right into the browser window no problem.

Why can it not run main.go, which again, resides in the same Windows folder as main2.go ?

What I have tried:

I have tried many variations of the FORM ACTION option to make the browser run an alternative element in the Windows folder locally.
Posted
Updated 2-Aug-22 8:41am

1 solution

Maybe current directory? Like the following:

./main.go


../main.go is up to parent then to main.go
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900