Skip to content Skip to sidebar Skip to footer

Make A Client-Server Application

I used to create web app in the same computer, but if the server and the client is not in the same computer, how can we access to the web page ? I mean, for example I have an html

Solution 1:

The "action" part of a form is an url, and If you don't specify the scheme://host:port part of the URL, the client will resolve it has the current page one. IOW: just put the path part of your script's URL and you'll be fine. FWIW hardcoding the scheme://host:port of your URLs is an antipattern, as you just found out.


Solution 2:

Your script is supposed to be run as a CGI script by a web-server, which sets environment variables like REMOTE_ADDR, REQUEST_METHOD ...

You are running the script by yourself, and this environment variable are not available.

That's why you get the KeyError.


Post a Comment for "Make A Client-Server Application"