visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Languages :: ASP :: VBS :: ASP (html content edit) script


By: pazzledesign Poland  Date: 27/09/2008 17:11:43  English  Points: 20 Status: Answered
Quality : Excellent
Guys i have a HTML page named me.htm

I am interested in being able to edit this on the go(edit it online), i don't have such option in my hosting panel

So i am looking for a simple solution. I am on a Windows server (ASP is supported)

Basically the page me.htm

consists of 1 <div> element which contains paragraphs

I need to just edit the content, the text and simply save it


Is there anything that anyone could recommend


Pref some type of user protection (but not necessary) so only certain people can edit it

Thanks
By: VGR Date: 27/09/2008 19:39:47 English  Type : Answer
frankly ? do it by FTP. You'll get the user protection (password to connect), security (change the FTP port, use a secure software like WarFTPd ) and easiness (edit on your machine, transfer, and it's done)

If you insist in editing the file online, I suggest you use some CMS - content management system - or, more basically, that you program that page to be an ASP script taking its contents in a database, that database itself being edited remotely from an other ASP script protected by a login/password authentication.
You'll find a basis for such a script called "GestDB.php" on the http://www.edainworks.com website, in the free webmaster's tools.

that's what I did and would do in your case. Just design your page to be some DIVs, valid HTML code, and put ASP code to extract the DIVs' contents from the database.

Then use the gestDB script to edit the database from remote.

Very easy, 5 minutes on windows ;-)
By: pazzledesign Date: 27/09/2008 21:08:20 English  Type : Comment
I have to have it online and it needs to be simple

SO i have the following code but it doesn't save can you have a look

<TEXTAREA name="bytheway" style="width:700px; height:700px;"><%
page_to_read="news1.htm"

set fso = createobject("scripting.filesystemobject")

set act = fso.opentextfile(server.mappath(page_to_read))

read_text = act.readall

act.close

response.write "<html>" & server.htmlencode(read_text) & "</html>"
%>
</TEXTAREA><input type="submit" method="POST" value="Submit" textarea="bytheway">
By: VGR Date: 28/09/2008 00:41:54 English  Type : Comment
well, I'm absolutely no ASP coder, but it seems that if you put this in a FORM with action=write.asp, then the write.asp page can write the file news1.htm back to disk, thus reaching your goal. You may also have action=same script in which case you'll have to code the DB write before redisplaying the textarea (which will then re-read the updated textarea contents, trivially).

BTW this is wrong :
<input type="submit" method="POST" value="Submit" textarea="bytheway">
there is no textarea attribute on the INPUT tag, the Mozilla Firefox browser + Tidy (HTML Validator) extension would have told you ;-)

you should have :

<form method="post" action="samescript.asp"> <textarea name="bytheway"> ... </textarea> <input type="submit" method="POST" value="Submit" name="save"> </form>



and this'll work. Just test that $_POST['save'] (or the equivalent in ASP) is set, check sanity of the input, addslashes() and off you go : write to the DB.
By: OpConsole Date: 03/04/2011 19:01:13 English  Type : Comment
force close

Do register to be able to answer

EContact
browser fav
page generated in 340.732100 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page