arrange page heading code

S

shank

Is there anything technically wrong with the way I have the below code
arranged? It works, but is not how I am used to seeing page headings layed
out.
thanks!

<%@LANGUAGE="VBSCRIPT"%>
<% response.buffer = true %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!--#include file="Connections/dbconnect.asp" -->
<%
sname = UCASE(Request.ServerVariables("SERVER_NAME"))
If InStr(sname,"NEWRELEASES") <> 0 then
response.redirect "http://www.mydomain.com/newproduct/"
ElseIf InStr(sname,"SPECIALS") <> 0 then
response.redirect "http://www.mydomain.com/specials/"
End If
%>
<html>
blah blah blah....
 
E

Evertjan.

shank wrote on 12 okt 2003 in microsoft.public.inetserver.asp.general:
Is there anything technically wrong with the way I have the below code
arranged? It works, but is not how I am used to seeing page headings
layed out.
thanks!

<%@LANGUAGE="VBSCRIPT"%>
<% response.buffer = true %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!--#include file="Connections/dbconnect.asp" -->
<%
sname = UCASE(Request.ServerVariables("SERVER_NAME"))
If InStr(sname,"NEWRELEASES") <> 0 then
response.redirect "http://www.mydomain.com/newproduct/"
ElseIf InStr(sname,"SPECIALS") <> 0 then
response.redirect "http://www.mydomain.com/specials/"
End If
%>
<html>
blah blah blah....

I would do the redirects first,
anyway before any output to clientside,
wich the DOCTYPE declaration is.
[In your version are only saved by the buffering.]
If you are only writing for your own machine [set on vbs],
I could do without the langage declaration.

===================================

<%@LANGUAGE="VBSCRIPT"%>
<%
sname = UCASE(Request.ServerVariables("SERVER_NAME"))
If InStr(sname,"NEWRELEASES") <> 0 then
response.redirect "http://www.mydomain.com/newproduct/"
ElseIf InStr(sname,"SPECIALS") <> 0 then
response.redirect "http://www.mydomain.com/specials/"
End If
%>
<% response.buffer = true %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!--#include file="Connections/dbconnect.asp" -->
<html>
blah blah blah....
 
K

Ken Schaefer

My style is

a) anything in an include needs to be in an function or sub - no inline
code, no HTML

b)

<% @ Declarations here, eg Language=VBScript %>
<%
Option Explicit
%>
<!-- #include files go here -->
<!-- #include files go here -->
<%
' Now do your response redirects if required:
sname = UCASE(Request.ServerVariables("SERVER_NAME"))

If InStr(sname,"NEWRELEASES") <> 0 then
response.redirect "http://www.mydomain.com/newproduct/"
ElseIf InStr(sname,"SPECIALS") <> 0 then
response.redirect "http://www.mydomain.com/specials/"
End If
%>

<! DOCTYPE= >
<html>
HTML content here
</html>

Cheers
Ken


: Is there anything technically wrong with the way I have the below code
: arranged? It works, but is not how I am used to seeing page headings layed
: out.
: thanks!
:
: <%@LANGUAGE="VBSCRIPT"%>
: <% response.buffer = true %>
: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
: <!--#include file="Connections/dbconnect.asp" -->
: <%
: sname = UCASE(Request.ServerVariables("SERVER_NAME"))
: If InStr(sname,"NEWRELEASES") <> 0 then
: response.redirect "http://www.mydomain.com/newproduct/"
: ElseIf InStr(sname,"SPECIALS") <> 0 then
: response.redirect "http://www.mydomain.com/specials/"
: End If
: %>
: <html>
: blah blah blah....
:
:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top