If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > open a database in a javascript function

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-15-04, 05:39
godno godno is offline
Registered User
 
Join Date: Oct 2004
Posts: 2
open a database in a javascript function

Hello,
I have this function in my ASP page:
function calcScore() {
var score=0;
var numCorrect = 0;
for (i=0 ; i<numQuestions ; i++) {
if (answer[i] == correctAnswer[i]) {
numCorrect = numCorrect + 1;

score=(numCorrect/numQuestions)*10;
}
}

alert('Your score is ' + score);

if(score >=5)
alert('you pass');
else
alert('you fail');
window.location="login.asp"

I want to open here my database and put in my table the score. Is this possible in a javascript function?
Reply With Quote
  #2 (permalink)  
Old 10-16-04, 20:31
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Is this client side javascript or sever side javascript? It looks like client side but I want to be sure...
Reply With Quote
  #3 (permalink)  
Old 10-21-04, 13:13
godno godno is offline
Registered User
 
Join Date: Oct 2004
Posts: 2
Quote:
Originally Posted by rokslide
Is this client side javascript or sever side javascript? It looks like client side but I want to be sure...

It is a client side.
Reply With Quote
  #4 (permalink)  
Old 10-21-04, 18:57
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
so from the client machine you want to open a connection to the database on your server and let them change data..... that'd be bad m'kay....

can you imagine the security nightmare that this would be??? what I would do is give them a link to click which would submit a http request back to the server which would update the database.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On