简体   繁体   中英

How can i send data to a server from an offline webpage?

I am fairly uneducated on webpage / server side scripting, but have made a basic webpage for some course work. I have a user feedback style forms (asking for an email and the comment, a suggestion about a potential charity to promote). This webpage will, presumably, be run on a standard PC with access to the web, but it will not be uploaded (Ie I'm sending the .HTML file to someone). How could I send information from the HTML forms to a free web-hosting server that I own? Thanks for any help, but please be noob friendly in your terminology!

The form is sent to the url of the action attribute:

<form action="http://yourserver.com/yourformhandler.php" ...>
    ...
</form>

Is the computer that will run your webpage connected to Internet ? If so, locate your form tag, and modify your html code to become something like this :

<form action="http://server.com/sendform.php">

For this to work you need to change the URL to fit your actual server, and have the php webpage use the data sent from the form to save it, but I suppose you already have that

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM