Forum Moderators: open

Message Too Old, No Replies

saving form data to text file

         

cherlee

1:20 pm on Feb 24, 2005 (gmt 0)

10+ Year Member



hi..!

i'm getting trouble about this :
there's a webpage where we should fill "name, address, email address, etc" to contact the company
the company asked me to submit the form data into a text file but the page is still as HTML
but i really don't know how to do this

i surfed this forum and found something similar to "saving data" but there was only about saving data in client's computer
how about saving data in the web server?

can someone help me?
i need it immediately
thanks

orion_rus

1:25 pm on Feb 24, 2005 (gmt 0)

10+ Year Member



)) nobody can give you an access to his server from a client side. This can do only with a server side languages like php,apsx or perl. If u haven't it or others you can do it on a server.
Good luck to you

Bernard Marx

3:41 pm on Feb 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Javascript is also a server-side language.
ASP is not a server-side language, it's a framework. It can be scripted in a number of laguages, including JScript.

cherlee

1:38 am on Feb 26, 2005 (gmt 0)

10+ Year Member



so there's no way to save a text data using JScript?
or still a chance?

it was really a blur to me when my supervisor asked me to save the form data not to a database, but only in text and he said it was no programming inside
is what he said true? what should i do?
does dreamweaver have a tool to do that?
as long as i know, dreamweaver doesn't have any tools like that

adni18

3:35 am on Feb 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you need to do this, find out if you have PHP or perl scripting.

Bernard Marx

12:50 pm on Feb 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



..or ASP

cherlee

6:44 am on Feb 27, 2005 (gmt 0)

10+ Year Member



i think i had miscommunication with my supervisor cuz the task was only a memo

i rethought about it and maybe this one is the one he wanted since i haven't get a chance to meet him
after we click the submit button, the page will create an email notification, just name it username@domain.com
can javascript make a package of email?
but i'm not sure who the sender is since it's only a button
what does a website usually do when we need to make a notification to a certain email address?

Rambo Tribble

2:15 pm on Feb 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A form's action attribute can be set to a mailto: URL and, on most systems, it will generate an email when submit is initiated. Unfortunately, IE doesn't always perform as expected (I think it may have to do with whether Outlook is set as the default mail client).

JavaScript can also compose an email, consider the following:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function sendMail(_frm){
var eml="you@youraddress.com";
var bod="&body="+_frm.selOne.value+" ¦¦ "+_frm.txtOne.value;
var subj="?subject=Whatever you want";
document.location="mailto:"+eml+subj+bod;
}
</script>
</head>
<body>
<form action="mailto:you@youraddress.com" enctype="text/plain"
method="POST" onsubmit="sendMail(this);return false;">
<select name="selOne">
<option value="Dog">Dog</option>
<option value="Cat">Cat</option>
</select>
<textarea name="txtOne"></textarea>
<input type="submit" value="Submit" />
</form>
</body>
</html>

Bear in mind that using JavaScript alone helps circumvent email-adddress-harvesting robots. The above uses JavaScript, but includes a mailto: as a backup for those who may have JavaScript turned off.

As regards saving a text file with client-side JavaScript: while JS cannot access the local file system to save a file, it can create a window with just the text file as content and the user can employ the browser's "File - Save [Page] As" menu options.

cherlee

1:14 pm on Mar 5, 2005 (gmt 0)

10+ Year Member



thanks.. i'll try it soon :)