J
jjfjr
Hi;
I'm creating an application that has the user fill out a form with a
username and password. The name and password are sent to an MS Access
database and a third piece of information is retrieved. This information is
the name of a cascading style sheet e.g. "tom.css". I want to pass this
string to a webpage so it will obey the rules in the CSS. The Access database
rows consist of the fields username, password and stylesheet.
My code to get the CSS info via the form is as follows:
if ((username == "") || (username == null))
alert("You must enter a username.");
if ((password == "") || (password == null))
alert("You must enter a password.");
SQLstr = "SELECT [stylesheet] FROM userinfo WHERE
(([username] = '" + document.user_form.username.value + "') AND
([password] = '" + document.user_form.password.value + "'))";
The code to connect to the database looks like this:
// connection string construction
var strConn = "Driver={Microsoft Access Driver
(*.mdb)};DBQ=" + Server.MapPath("users.mdb");
// connection object creation
var dbConn = Server.CreateObject("ADODB.Connection");
// open the connection
dbConn.Open(strConn);
// Execute the query with constructed SQLstr
var rs = dbConn.Execute(SQLstr);
I'm planning to put the following code in the form page to pass the result
of the query to the page ("Gettysburg. htm") that will follow the CSS rules:
<a href="Gettysburg.asp?styles=<% rs %>
Will the variable rs have captured the CSS string?
I was then going to put the following code in the HEAD of the Gettysburg
page in order to link things up:
<link rel="stylesheet" type="text/css"
href="/styles/"<%=request.querystring(styles) %>" media="screen">
Does this sound like it should work?
Any help is greatly appreciated.
I'm creating an application that has the user fill out a form with a
username and password. The name and password are sent to an MS Access
database and a third piece of information is retrieved. This information is
the name of a cascading style sheet e.g. "tom.css". I want to pass this
string to a webpage so it will obey the rules in the CSS. The Access database
rows consist of the fields username, password and stylesheet.
My code to get the CSS info via the form is as follows:
if ((username == "") || (username == null))
alert("You must enter a username.");
if ((password == "") || (password == null))
alert("You must enter a password.");
SQLstr = "SELECT [stylesheet] FROM userinfo WHERE
(([username] = '" + document.user_form.username.value + "') AND
([password] = '" + document.user_form.password.value + "'))";
The code to connect to the database looks like this:
// connection string construction
var strConn = "Driver={Microsoft Access Driver
(*.mdb)};DBQ=" + Server.MapPath("users.mdb");
// connection object creation
var dbConn = Server.CreateObject("ADODB.Connection");
// open the connection
dbConn.Open(strConn);
// Execute the query with constructed SQLstr
var rs = dbConn.Execute(SQLstr);
I'm planning to put the following code in the form page to pass the result
of the query to the page ("Gettysburg. htm") that will follow the CSS rules:
<a href="Gettysburg.asp?styles=<% rs %>
Will the variable rs have captured the CSS string?
I was then going to put the following code in the HEAD of the Gettysburg
page in order to link things up:
<link rel="stylesheet" type="text/css"
href="/styles/"<%=request.querystring(styles) %>" media="screen">
Does this sound like it should work?
Any help is greatly appreciated.