HTML Question

Programming, for all ages and all languages.
Tim

Re:HTML Question

Post by Tim »

Who is hosting your web site? If they support PHP then it is really easy to do what you want. I don't know of any way of saving to the server without any server-side code; in fact, the ability to save to the server from a web browser would be a huge security hole. Regarding email, you could get some success with a mailto:... URL, but that would bring up an email in the users email program.
Curufir

Re:HTML Question

Post by Curufir »

If all you have is HTML and Javascript then you can't do anything dynamic because there's nothing at the server side to process the information being sent.

Best you could hope for, without the user being forced to send an email, or click on a file dialogue, is to store a very limited amount of information in a cookie (4096 bytes maximum AFAIK). That information could be used on the client side by Javascript to pass information between pages and give the illusion that your site is dynamic, but it would involve writing a lot of extra Javascript and wouldn't allow you to share information between different users.

The solution to your problem is server side scripting. There are many free hosts that offer some kind of scripting support, and even some that offer a small amount of database space.
AGI1122

Re:HTML Question

Post by AGI1122 »

Actually if you have ftp access it would be possible if you set up your computer as a server that can parse php.

What you would do is make it so your computer is always online and set to allow access from outside ip's on the server.

Then have the form data sent to a php script on your computer then it parses the data and uses it's ftp functionality to connect the site and update the static data then send the user to the new updated page.

Of course this assumes that you would be willing to turn your computer into a server and that you would be leaving it turned on and connected to the internet at all times. And also that your web site has ftp access.

Other than this method, there is no way to write to a server without server side scripting.
Eero Ränik

Re:HTML Question

Post by Eero Ränik »

Yeah, but if the page needs to be updated, and the address is probably predefined, what happens when two users are trying to post their form in the same time? I think the page could be shown from your home server... If it's the same page for all users, it can be on your site.
AGI1122

Re:HTML Question

Post by AGI1122 »

Well you could store the data in a MySQL database each time it's updated. Then have a cron job compare the file on the server with the data in the database, if they are not the same then it needs to update the file on the server.

As for hosting it totally on his own server, it is kind of a pain for outsiders to remember ip addresses since I doubt he is going to buy a domain name for his computer. ;)
Eero Ränik

Re:HTML Question

Post by Eero Ränik »

No, I mean only the page what appears after submitting the form... Anyway there are plenty of dynamic IP redirecting services.
AGI1122

Re:HTML Question

Post by AGI1122 »

Who said anything about a dynamic ip? :P
Eero Ränik

Re:HTML Question

Post by Eero Ränik »

You can use those services with static IP too... ::)
Post Reply