brentnewbury
Programmer
I am trying to make HTML (and some asp embeded with the HTML) templates that can are stored in a database and can be modified or selected and displayed. If any of you have used vBulletin before you will know what I am talking about.
Well here is what I have in my database:
<html>
<head>
<title>Members Login</title>
<link rel="stylesheet" type="text/css" href="centurion.css">
</head>
<body>
<center>
<form method="POST" action="login.asp">
<table width=100% height=85% cellpadding=0 cellspacing=0 border=0>
<tr>
<td align="center" valign="center">
<table width=50% cellpadding=5 cellspacing=0 border=0>
<tr>
<td height=40 align="center" colspan=2>
<div class="error">
<% If Request.Cookies("FormError" <> "" Then %>
<div class="error">
<% Request.Cookies("FormError" %>
</div>
<% End If
If Request.Cookies("FormSuccess" <> "" Then %>
<div class="success">
<% Request.Cookies("FormSuccess"
End If %>
</div>
</td>
</tr>
<tr>
<td align="center" valign="center" colspan=2>
<div class="text">
<b>Please enter your username and password</b>
</td>
</tr>
<tr>
<td height=12>
</td>
</tr>
<tr>
<td align="right" valign="center">
<div class="text">
Username:
</div>
</td>
<td width=55%>
<input type="text" name="UserName" Response.Write(value=" & <% Request.Cookies('UserName') & " class="input">
</td>
</tr>
<tr>
<td align="right">
<div class="text">
Password:
</div>
</td>
<td>
<input type="password" name="UserPassword" class="input">
</td>
</tr>
<tr>
<td align="right" height=10>
</td>
<td>
</td>
</tr>
<tr>
<td width=50% align="center" colspan=2>
<input type="submit" width="50" name=Submit value="Login" class="button">
<input type="reset" value="Reset" class="button">
</td>
</tr>
<tr>
<td height=40 align="center" valign="bottom" colspan=2>
<div id="small" class="text">
<a href="signup.asp">Want to be a member?</a> | <a href="send_password.asp">Forgot your login details?</a>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width=100% height=35 cellpadding=5 cellspacing=0 border=0>
<tr>
<td align="center" valign="center">
<div class="navtext">
</div>
</td>
</tr>
</table>
<!-- #include file="copyright.asp" -->
</form>
</center>
</body>
</html>
Here is the code that calls it:
'========== Get HTML Template From database ==========
SQLGetTemplate1 = "SELECT * FROM TemplateTable WHERE TemplateID = 1"
Set rsGetTemplate1 = Conn.Execute(SQLGetTemplate1)
'========== Display HTML Page ==========
Response.Write(rsGetTemplate1("Template")
The ASP embeded within the HTML is not working, so ASP doesn't realise it is being called.
If your first piece of advice would be to remove the "" chars in the HTML parts of the code and replace the '<%' with '" &' and also '%>' with '& "', then your wrong, I have tried this and it still doesn't work. I have tried many variations but they just don't work.
If any of you could make the embeded ASP work within the HTML then it will be a greate help.
Thank you very much,
Brent Newbury
Well here is what I have in my database:
<html>
<head>
<title>Members Login</title>
<link rel="stylesheet" type="text/css" href="centurion.css">
</head>
<body>
<center>
<form method="POST" action="login.asp">
<table width=100% height=85% cellpadding=0 cellspacing=0 border=0>
<tr>
<td align="center" valign="center">
<table width=50% cellpadding=5 cellspacing=0 border=0>
<tr>
<td height=40 align="center" colspan=2>
<div class="error">
<% If Request.Cookies("FormError" <> "" Then %>
<div class="error">
<% Request.Cookies("FormError" %>
</div>
<% End If
If Request.Cookies("FormSuccess" <> "" Then %>
<div class="success">
<% Request.Cookies("FormSuccess"
End If %>
</div>
</td>
</tr>
<tr>
<td align="center" valign="center" colspan=2>
<div class="text">
<b>Please enter your username and password</b>
</td>
</tr>
<tr>
<td height=12>
</td>
</tr>
<tr>
<td align="right" valign="center">
<div class="text">
Username:
</div>
</td>
<td width=55%>
<input type="text" name="UserName" Response.Write(value=" & <% Request.Cookies('UserName') & " class="input">
</td>
</tr>
<tr>
<td align="right">
<div class="text">
Password:
</div>
</td>
<td>
<input type="password" name="UserPassword" class="input">
</td>
</tr>
<tr>
<td align="right" height=10>
</td>
<td>
</td>
</tr>
<tr>
<td width=50% align="center" colspan=2>
<input type="submit" width="50" name=Submit value="Login" class="button">
<input type="reset" value="Reset" class="button">
</td>
</tr>
<tr>
<td height=40 align="center" valign="bottom" colspan=2>
<div id="small" class="text">
<a href="signup.asp">Want to be a member?</a> | <a href="send_password.asp">Forgot your login details?</a>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width=100% height=35 cellpadding=5 cellspacing=0 border=0>
<tr>
<td align="center" valign="center">
<div class="navtext">
</div>
</td>
</tr>
</table>
<!-- #include file="copyright.asp" -->
</form>
</center>
</body>
</html>
Here is the code that calls it:
'========== Get HTML Template From database ==========
SQLGetTemplate1 = "SELECT * FROM TemplateTable WHERE TemplateID = 1"
Set rsGetTemplate1 = Conn.Execute(SQLGetTemplate1)
'========== Display HTML Page ==========
Response.Write(rsGetTemplate1("Template")
The ASP embeded within the HTML is not working, so ASP doesn't realise it is being called.
If your first piece of advice would be to remove the "" chars in the HTML parts of the code and replace the '<%' with '" &' and also '%>' with '& "', then your wrong, I have tried this and it still doesn't work. I have tried many variations but they just don't work.
If any of you could make the embeded ASP work within the HTML then it will be a greate help.
Thank you very much,
Brent Newbury