473,465 Members | 1,651 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Store the answer to a question

I want to ask a visitor the reason they visited our website using
javascript:

Var strReason = Prompt("Why did you visit?")

How can I store this in a text file or Access database?

TIA
Mark
Feb 1 '08 #1
12 1500
Mark1234567 wrote:
I want to ask a visitor the reason they visited our website using
javascript:

Var strReason = Prompt("Why did you visit?")

How can I store this in a text file or Access database?
Hi,

How? By posting the answer to your server, and handle it from there.
JavaScript can, at most, help you post it, but it cannot store in in a
database, or flat file.

You need to use a serversidelanguage for that, like PHP.
(Actually, JavaScript can also be used serverside, but that is rare.)

Regards,
Erwin Moller
>
TIA
Mark
Feb 1 '08 #2
Mark1234567 wrote:
I want to ask a visitor the reason they visited our website using
javascript:

Var strReason = Prompt("Why did you visit?")

How can I store this in a text file or Access database?
In 99.x% of the cases, you have three options:

- You can store it in a file at server;
- You can store it in a database at server (e.g. Access);
- You can store it in a cookie at client.

Hope this helps,

--
Bart
Feb 1 '08 #3
Do you know what the Javascript code would be to store it in a flat
file on our server?
On Feb 2, 10:40*am, Bart Van der Donck <b...@nijlen.comwrote:
Mark1234567 wrote:
I want to ask a visitor the reason they visited our website using
javascript:
Var strReason = Prompt("Why did you visit?")
How can I store this in a text file or Access database?

In 99.x% of the cases, you have three options:

- You can store it in a file at server;
- You can store it in a database at server (e.g. Access);
- You can store it in a cookie at client.

Hope this helps,

--
*Bart
Feb 1 '08 #4
Do you have any Javascript code that would do this?
On Feb 1, 10:38*pm, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
Mark1234567 wrote:
I want to ask a visitor the reason they visited our website using
javascript:
Var strReason = Prompt("Why did you visit?")
How can I store this in a text file or Access database?

Hi,

How? By posting the answer to your server, and handle it from there.
JavaScript can, at most, help you post it, but it cannot store in in a
database, or flat file.

You need to use a serversidelanguage for that, like PHP.
(Actually, JavaScript can also be used serverside, but that is rare.)

Regards,
Erwin Moller


TIA
Mark- Hide quoted text -

- Show quoted text -
Feb 1 '08 #5
Mark1234567 wrote:
On Feb 2, 10:40 am, Bart Van der Donck <b...@nijlen.comwrote:
>Mark1234567 wrote:
>>I want to ask a visitor the reason they visited our website
using javascript:
Var strReason = Prompt("Why did you visit?")
How can I store this in a text file or Access database?
>In 99.x% of the cases, you have three options:
- You can store it in a file at server;
- You can store it in a database at server (e.g. Access);
- You can store it in a cookie at client.
Do you know what the Javascript code would be to store it in a flat
file on our server?
It is not possible to perform such a task in client-side javascript.
You need a server-side language for that (PHP, ASP, ...).

--
Bart
Feb 1 '08 #6
Mark1234567 wrote on 01 feb 2008 in comp.lang.javascript:
On Feb 1, 10:38*pm, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
>Mark1234567 wrote:
I want to ask a visitor the reason they visited our website using
javascript:
Var strReason = Prompt("Why did you visit?")
How can I store this in a text file or Access database?

Hi,

How? By posting the answer to your server, and handle it from there.
JavaScript can, at most, help you post it, but it cannot store in in a
database, or flat file.

You need to use a serversidelanguage for that, like PHP.
(Actually, JavaScript can also be used serverside, but that is rare.)
Perhaps it is rare to you Erwin, but not to the cyberworld.

[Please do not toppost on usenet]
Do you have any Javascript code that would do this?
You can user scripting.filesystemobject for that.

This is for appending text, I think [not tested]:

var theFile = server.mapPath('myFile.txt');
var fso = new ActiveXObject('Scripting.FileSystemObject');
var o = fso.OpenTextFile(theFile, 8, true,0);
o.write(sText);
o.close();
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Feb 1 '08 #7

"Mark1234567" <Au************@gmail.comwrote in message
news:94**********************************@j78g2000 hsd.googlegroups.com...
Do you know what the Javascript code would be to store it in a flat
file on our server?

Is your server MS IIS? If so, then ASP with Javascript is apparently what
you're insisting on using.
Is your page an 'ASP' - or HTML page?
In other words, What is the existing condition?
Feb 2 '08 #8
VK said the following on 2/4/2008 3:25 PM:

<snip>
The overall future of Javascript is rather cloudy now, especially with
possible changes in the camp 2) with Yahoo! currently considering the
acquisition proposal from Microsoft
http://yhoo.client.shareholder.com/p...leaseID=291270
If you can't beat them, buy them out :)

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 4 '08 #9
VK
acquisition proposal from Microsoft
http://yhoo.client.shareholder.com/p...cfm?ReleaseID=...

If you can't beat them, buy them out :)
Yeah, I'm getting tired to go away to the West... Strange people with
thunder sticks are still coming sooner or later to the land... :-)

First I dropped Hotmail, now my ol'good Yahoo! Mail, now what? over
the mountains to GMail? :-)

They did not say "yes" though.

Feb 4 '08 #10
VK
On Feb 5, 12:22 am, VK <schools_r...@yahoo.comwrote:
They did not say "yes" though.
... yet
Feb 4 '08 #11
VK said the following on 2/4/2008 4:24 PM:
On Feb 5, 12:22 am, VK <schools_r...@yahoo.comwrote:
>They did not say "yes" though.
... yet
Money talks. If MS' decides they want Yahoo! bad enough, they will get
Yahoo! and it actually makes decent business sense to buy Yahoo!. They
get YUI, the IM area, and all the advertising.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 4 '08 #12
Wow, nice longggg answer to the poor guy.
Mark, why not just use a form field and save the response?
On Feb 1, 1:12*am, Mark1234567 <Audit.Orbis...@gmail.comwrote:
I want to ask a visitor the reason they visited our website using
javascript:

Var strReason = Prompt("Why did you visit?")

How can I store this in a text file or Access database?

TIA
Mark
Feb 5 '08 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mohammed Mazid | last post by:
Basically I want to store the answer of a single-choice question (where candidate selects one answer) and multiple-choice question (where candidate selects more than one answer). I would like to...
5
by: Guadala Harry | last post by:
What are my options for *securely* storing/retrieving the ID and password used by an ASP.NET application for accessing a SQL Server (using SQL Server authentication)? Please note that this ID and...
1
by: David | last post by:
One thing that's always puzzled me about implementing encryption on remote asp.net apps is where to store the keys. The demo code indicate that you include them in a configuration file, but this...
7
by: Alan Silver | last post by:
Hello, I am just looking at VWD and seeing what needs doing to take an existing site I've written by hand and importing it into VWD. I've already discovered that I need to rename my code-behind...
10
by: Peter Stojkovic | last post by:
I want store an integer-array of 1000 Values in a blob in a SQL-database. I will do this every 10 Seconds. How can I do this ???? What datatypes a have to use ??? Thanks
7
by: Shadow Lynx | last post by:
I realize that his question has been asked, in many other forms, many times in this group. Even so, my tired eyes have not yet found a sufficient answer, so I've decided to "reask" it even though...
5
by: Sukh | last post by:
I have to design a "Online Test Application" and application is going to display question and answers.All the questons are objective type so there is four answer for each question. My Question is...
3
by: Sukh | last post by:
I have to design a "Online Test Application" and application is going to display question and answers.All the questons are objective type so there is four answer for each question. My Question is...
8
by: theCancerus | last post by:
Hi All, I am not sure if this is the right place to ask this question but i am very sure you may have faced this problem, i have already found some post related to this but not the answer i am...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.