Reputation: 1817
For example- could the user change the actual code of the HTML from the web browser using a JavaScript prompt?
If I had the following code.
<html>
<head>
<script>var person = prompt("Please enter your name");</script>
</head>
<body>
<p>This should be user amendable</p>
<p>This shouldn't</p>
</body>
</html>
I don't mean to store the variable person
temporarily, but actually change the HTML code and replace it with the value of the variable?
Upvotes: 0
Views: 238
Reputation: 3186
If your prompt submits the data to a form handler written in PHP or some other server side application, it can access the file system in a way in which you could permanently edit the content, however you should avoid doing this for security purposes without creating a much more robust system in which to check that the information entered into the prompt is not malicious. In short, this is best left to CMS (Content Management System), which are more likely to save the actual "content" of your website as part of a database structure.
Upvotes: 0
Reputation: 943569
Not as such. Alternatives include:
Upvotes: 3