navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Free FrontPage Templates

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Substring problem/ hyperlink question

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Substring problem/ hyperlink question
Page: [1]
 
rrnml

 

Posts: 197
Joined: 9/20/2004
Status: offline

 
Substring problem/ hyperlink question - 8/3/2005 12:32:41   
I have a query that displays a user name like this .... NMLW2K/john. I would like to substring it to just display john. It worked on the first page of my query but on the second page it won't work. I'm thinking it's because the user name is not being submitted by a form on the second page. I will submit the code for a better picture. Also on the second page(InternetDestinations4) it displays the DestHost at the top of the page and I was wondering if there is a way to hyperlink that to the actual site. For example, if it says www.aol.com, I would like to be able to click on it and have it go to aol.com. Any help is greatly appreciated. Thanks.

InternetDestinationsUser.asp (1st page)
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>

<head>
<title>Internet Destinations</title>

<meta name="Microsoft Border" content="tb">
</head>

<body>

<%
Dim con 
Dim rst
Dim strSQL
Dim strParm1
Dim strParm2
Dim strParm3
Dim strParm4
Dim strSQLWhere


Const adOpenKeyset = 0
Const adLockOptimistic = 1

'Create the objects 
Set con = Server.CreateObject("ADODB.Connection") 
Set rst = Server.CreateObject("ADODB.Recordset") 

' Open the connection to NMLFIRE 
con.Open "ProxyDB", "sqlquery", "querysql"
 con.CommandTimeout = 0

' Create the SQL Query String
strParm1 = Request.Form("searchterm")
strParm2 = Request.Form("scname")
strParm5 = Mid(strParm2,1,7)
strParm3 = Request.Form("fdate")
strParm4 = Request.Form("tdate")


'Response.Write strParm1
'Response.Write strParm2
'Response.Write strParm3
'Response.Write strParm4


strSQL = " select DISTINCT DestHost, ClientUserName " &_
         " from CleanedWebProxyLog " & _
         " where (logDate between '" & strParm3 & "' and '" & strParm4 & "')  " & _
         " and ((ClientUserName like '%" & strParm5 & "%') and (DestHost like 'www%')) " & _
         " Order by DestHost "
                     		 
'Response.write strSQL

server.ScriptTimeOut = 600

rst.Open strSQL, con, adOpenKeyset, adLockOptimistic

'Only display records if there are records in the recordset

If NOT rst.EOF then
  'Display the header
%>
<div align="center">

<p align="center"><b>Internet Destinations </b> </p>

<p align="center"><b>from <%=Request.Form("fdate")%></b></p>

<p align="center"><b>thru <%=Request.Form("tdate")%></b> </p>

<p align="center"><b> for <font color="#FF0000"> <%=Request.Form("scname")%></b>
</font></p>

<p align="center"> <b> <font color="#0000FF">Click on the link to view activity</font> </b></p>

<div align="center"><center>

<table BORDER="1" height="57" width="501">
  <tr>
    <td align="center" height="17" width="491"><b>Destinations</b></td>
  </tr>
<%
'Loop through the recordset until there are no more records


Do While Not rst.EOF
%>
<tr>
  <td align="center" height="29" width="491"><a href="InternetDestinations4.asp?Dest=<%=rst("DestHost")%>&From=<%=Request.Form("fdate")%>&Thru=<%=Request.Form("tdate")%>&User=<%=rst("ClientUserName")%>" target="_blank"><%=rst("DestHost")%> 
</td>
 </tr>
<% 

'If you forget this next statement, you will be stuck in a loop
rst.MoveNext

Loop


Else

%>
 
<b>
  <tr>
    <td align="center" height="23" width="491">No records in recordset!  </b>
<%

%>
</td>
    
  </b>
      
<p></p>

      
<p></p>


      
<p></p>



      
<%
End If



rst.Close
con.Close
%></html>



InternetDestinations4.asp (2nd page)

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>

<head>
<title>Internet Destinations</title>


<meta name="Microsoft Border" content="tb">
</head>

<body>

<%
Dim con 
Dim rst
Dim strSQL
Dim strParm1
Dim strParm2
Dim strParm3
Dim strParm4

Const adOpenKeyset = 0
Const adLockOptimistic = 1


'Create the objects 
Set con = Server.CreateObject("ADODB.Connection") 
Set rst = Server.CreateObject("ADODB.Recordset") 

' Open the connection to NMLFIRE 
con.Open "ProxyDB", "sqlquery", "querysql"
 con.CommandTimeout = 0

' Create the SQL Query String
strParm1 = Request("Dest")
strParm2 = Request("User")
strParm5 = Mid(strParm2,1,7)
strParm3 = Request("From")
strParm4 = Request("Thru")


'Response.Write strParm1
'Response.Write strParm2
'Response.Write strParm3
'Response.Write strParm4


strSQL = " select DISTINCT logTime, ClientUserName, DestHost, logDate " & _
	     " from CleanedWebProxyLog " & _ 
		 " where (ClientUserName like '%" & strParm5 & "%')" & _ 
		 " and (logDate between '" & strParm3 & "' and '" & strParm4 & "') " & _
		 " and (DestHost like '%" & strParm1 & "%') " & _
		 " Order by logDate "
		 		 		 
'Response.write strSQL

server.ScriptTimeOut = 600

rst.Open strSQL, con, adOpenKeyset, adLockOptimistic

' Only display records if there are records in the recordset

If NOT rst.EOF then
  'Display the header
%>
<div align="center">

<p align="center"><b>Internet Destinations from <%=Request("From")%> thru <%=Request("Thru")%></b> </p>

<p align="center"><b>  <font color="#FF0000"><%=Request("Dest")%></b></p></font>

<p align="center"><b> <%=Request("User")%></b></p>

<div align="center"><center>
	
<table BORDER="1" height="57" width="501">
  <tr>
    <td align="center" height="17" width="491"><b>Users</b></td>
    <td align="center" height="17" width="491"><b>Date</b></td>
    <td align="center" height="17" width="491"><b>Time</b></td>
  </tr>
  <tr>
<%
'Loop through the recordset until there are no more records

Do While Not rst.EOF
%>
<tr>
  <td width="491" height="29"><%=rst("ClientUserName")%>
    </td>
  <td width="491" height="29"><%=rst("logDate")%>
    </td>
  <td width="491" height="29"><%=rst("logTime")%>
    </td>
 </tr>    
<% 
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop

  
Else

 %>
<b>
  <tr>
    <td align="center" height="23" width="491">No records in recordset!  </b>
<%


End If


rst.Close
con.Close

%>
</td></tr></b>
<p></p>

</html>

rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Substring problem/ hyperlink question - 8/3/2005 12:42:36   
quote:

NMLW2K/john.


There was a post recently that was similar. A script something like this was the solution:

<%
DIM myUserName
MyVar=request.servervariables("logon_user")
MyVar=MyVar & ""
MyPos = InstrRev(MyVar, "/", -1, 1)
myUserName=Mid(MyVar,MyPos+1,Len(MyVar))
'Response.write(myUserName & "<br>")
%>

Just replace request.servervariables("logon_user") with your variable call. That help any?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to rrnml)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Substring problem/ hyperlink question - 8/3/2005 12:44:45   
quote:

<%=Request("Dest")%>


As to making this a link, how about this:

<a href="<%=Request("Dest")%>" target="_blank"><%=Request("Dest")%></a>

That should build it into a link that opens in a new page. That help?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to rdouglass)
rrnml

 

Posts: 197
Joined: 9/20/2004
Status: offline

 
RE: Substring problem/ hyperlink question - 8/3/2005 16:48:26   
So I tried both of those. The first solution didn't change anything regarding the NMLW2K/ thing. Not sure if I put it in the right place or whatever I did wrong. The second one did create a hyperlink but it takes you nowhere because in the location bar it says .... http://internal/Queries/www.aol.com
Obviously this page does not exist on our intranet. Is there a way to substring that to just cut out the http://internal/Queries/ part? Here is the code. If you can see what I did wrong please let me know. Thanks.

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>

<head>
<title>Internet Destinations</title>


<meta name="Microsoft Border" content="tb">
</head>

<body>

<%
Dim con 
Dim rst
Dim strSQL
Dim strParm1
Dim strParm2
Dim strParm3
Dim strParm4

DIM myUserName 
MyVar=request.servervariables("User") 
MyVar=MyVar & "" 
MyPos = InstrRev(MyVar, "/", -1, 1) 
myUserName=Mid(MyVar,MyPos+1,Len(MyVar))

Const adOpenKeyset = 0
Const adLockOptimistic = 1


'Create the objects 
Set con = Server.CreateObject("ADODB.Connection") 
Set rst = Server.CreateObject("ADODB.Recordset") 

' Open the connection to NMLFIRE 
con.Open "ProxyDB", "sqlquery", "querysql"
 con.CommandTimeout = 0

' Create the SQL Query String
strParm1 = Request("Dest")
strParm2 = Request("User")
strParm5 = Mid(strParm2,1,7)
strParm3 = Request("From")
strParm4 = Request("Thru")


'Response.Write strParm1
'Response.Write strParm2
'Response.Write strParm3
'Response.Write strParm4


strSQL = " select DISTINCT logTime, ClientUserName, DestHost, logDate " & _
	     " from CleanedWebProxyLog " & _ 
		 " where (ClientUserName like '%" & myUserName & "%')" & _ 
		 " and (logDate between '" & strParm3 & "' and '" & strParm4 & "') " & _
		 " and (DestHost like '%" & strParm1 & "%') " & _
		 " Order by logDate "
		 		 		 
'Response.write strSQL

server.ScriptTimeOut = 600

rst.Open strSQL, con, adOpenKeyset, adLockOptimistic

' Only display records if there are records in the recordset

If NOT rst.EOF then
  'Display the header
%>
<div align="center">

<p align="center"><b>Internet Destinations from <%=Request("From")%> thru <%=Request("Thru")%></b> </p>

<p align="center"><b>  <font color="#FF0000"><a href="<%=Request("Dest")%>" target="_blank"><%=Request("Dest")%></a></b></p></font>

<p align="center"><b> <%=Request("User")%></b></p>

<div align="center"><center>
	
<table BORDER="1" height="57" width="501">
  <tr>
    <td align="center" height="17" width="491"><b>Users</b></td>
    <td align="center" height="17" width="491"><b>Date</b></td>
    <td align="center" height="17" width="491"><b>Time</b></td>
  </tr>
  <tr>
<%
'Loop through the recordset until there are no more records

Do While Not rst.EOF
%>
<tr>
  <td width="491" height="29"><%=rst("ClientUserName")%>
    </td>
  <td width="491" height="29"><%=rst("logDate")%>
    </td>
  <td width="491" height="29"><%=rst("logTime")%>
    </td>
 </tr>    
<% 
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop

  
Else

 %>
<b>
  <tr>
    <td align="center" height="23" width="491">No records in recordset!  </b>
<%


End If


rst.Close
con.Close

%>
</td></tr></b>
<p></p>

</html>


(in reply to rdouglass)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Substring problem/ hyperlink question - 8/5/2005 12:45:41   
quote:

DIM myUserName
MyVar=request.servervariables("User")
MyVar=MyVar & ""
MyPos = InstrRev(MyVar, "/", -1, 1)
myUserName=Mid(MyVar,MyPos+1,Len(MyVar))


Let's do 1 thing at a time. Make that code look like this:

....
DIM myUserName
MyVar=request.servervariables("User")
MyVar=MyVar & ""
MyPos = InstrRev(MyVar, "/", -1, 1)
myUserName=Mid(MyVar,MyPos+1,Len(MyVar))

Response.write(myUserName)
Response.end

....

You should see *something* written to the browser there. If you do not, make sure (using IIS Manager) the directory has Anonymous Access off and Integrated Authentication on and try again.

That any help? Once that's working, we'll address the second question.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to rrnml)
rrnml

 

Posts: 197
Joined: 9/20/2004
Status: offline

 
RE: Substring problem/ hyperlink question - 8/8/2005 11:45:08   
I tried your suggestion and when I click on the link, the page that displays is blank.

(in reply to rdouglass)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Substring problem/ hyperlink question - 8/8/2005 11:59:59   
quote:

the page that displays is blank


Well that is telling me that 1 of 2 things are happening, probably 1 thing.

1. The directory that contains this page still has anonymous access enabled.

2. The user is not logged into the domain. Altho if this is the case, I'd expect a login prompt to appear.

I suspect #1 is the cause. Can you confirm this?

quote:

the directory has Anonymous Access off and Integrated Authentication on


That any help?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to rrnml)
rrnml

 

Posts: 197
Joined: 9/20/2004
Status: offline

 
RE: Substring problem/ hyperlink question - 8/8/2005 12:27:55   
Well I did go in and it was enabled but I disabled it and enabled the other like you said and it still displays a blank page.

(in reply to rdouglass)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Substring problem/ hyperlink question - 8/8/2005 13:10:59   
Can you post the full page code you're using? I'll pop it onto one of my servers and see if I can pick out anything more.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to rrnml)
rrnml

 

Posts: 197
Joined: 9/20/2004
Status: offline

 
RE: Substring problem/ hyperlink question - 8/8/2005 13:22:36   
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>

<head>
<title>Internet Destinations</title>


<meta name="Microsoft Border" content="tb">
</head>

<body>

<%
Dim con 
Dim rst
Dim strSQL
Dim strParm1
Dim strParm2
Dim strParm3
Dim strParm4

DIM myUserName 
MyVar=request.servervariables("User") 
MyVar=MyVar & "" 
MyPos = InstrRev(MyVar, "/", -1, 1) 
myUserName=Mid(MyVar,MyPos+1,Len(MyVar))

Response.write myUserName
Response.end

Const adOpenKeyset = 0
Const adLockOptimistic = 1


'Create the objects 
Set con = Server.CreateObject("ADODB.Connection") 
Set rst = Server.CreateObject("ADODB.Recordset") 

' Open the connection to NMLFIRE 
con.Open "ProxyDB", "sqlquery", "querysql"
 con.CommandTimeout = 0

' Create the SQL Query String
strParm1 = Request("Dest")
strParm2 = Request("User")
strParm5 = Mid(strParm2,1,7)
strParm3 = Request("From")
strParm4 = Request("Thru")


'Response.Write strParm1
'Response.Write strParm2
'Response.Write strParm3
'Response.Write strParm4


strSQL = " select DISTINCT logTime, ClientUserName, DestHost, logDate " & _
	     " from CleanedWebProxyLog " & _ 
		 " where (ClientUserName like '%" & myUserName & "%')" & _ 
		 " and (logDate between '" & strParm3 & "' and '" & strParm4 & "') " & _
		 " and (DestHost like '%" & strParm1 & "%') " & _
		 " Order by logDate "
		 		 		 
'Response.write strSQL

server.ScriptTimeOut = 600

rst.Open strSQL, con, adOpenKeyset, adLockOptimistic

' Only display records if there are records in the recordset

If NOT rst.EOF then
  'Display the header
%>
<div align="center">

<p align="center"><b>Internet Destinations from <%=Request("From")%> thru <%=Request("Thru")%></b> </p>

<p align="center"><b>  <font color="#FF0000"><a href="<%=Request("Dest")%>" target="_blank"><%=Request("Dest")%></a></b></p></font>

<p align="center"><b> <%=Request("User")%></b></p>

<div align="center"><center>
	
<table BORDER="1" height="57" width="501">
  <tr>
    <td align="center" height="17" width="491"><b>Users</b></td>
    <td align="center" height="17" width="491"><b>Date</b></td>
    <td align="center" height="17" width="491"><b>Time</b></td>
  </tr>
  <tr>
<%
'Loop through the recordset until there are no more records

Do While Not rst.EOF
%>
<tr>
  <td width="491" height="29"><%=rst("ClientUserName")%>
    </td>
  <td width="491" height="29"><%=rst("logDate")%>
    </td>
  <td width="491" height="29"><%=rst("logTime")%>
    </td>
 </tr>    
<% 
'If you forget this next statement, you will be stuck in a loop
rst.MoveNext
Loop

  
Else

 %>
<b>
  <tr>
    <td align="center" height="23" width="491">No records in recordset!  </b>
<%


End If


rst.Close
con.Close

%>
</td></tr></b>
<p></p>

</html>



and here's the form
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>

<head>
<title>Internet Destinations</title>

<meta name="Microsoft Border" content="tb">
</head>

<body>

<%
Dim con 
Dim rst
Dim strSQL
Dim strParm1
Dim strParm2
Dim strParm3
Dim strParm4
Dim strSQLWhere


Const adOpenKeyset = 0
Const adLockOptimistic = 1

'Create the objects 
Set con = Server.CreateObject("ADODB.Connection") 
Set rst = Server.CreateObject("ADODB.Recordset") 

' Open the connection to NMLFIRE 
con.Open "ProxyDB", "sqlquery", "querysql"
 con.CommandTimeout = 0

' Create the SQL Query String
strParm1 = Request.Form("searchterm")
strParm2 = Request.Form("scname")
strParm5 = Mid(strParm2,1,7)
strParm3 = Request.Form("fdate")
strParm4 = Request.Form("tdate")


'Response.Write strParm1
'Response.Write strParm2
'Response.Write strParm3
'Response.Write strParm4


strSQL = " select DISTINCT DestHost, ClientUserName " &_
         " from CleanedWebProxyLog " & _
         " where (logDate between '" & strParm3 & "' and '" & strParm4 & "')  " & _
         " and ((ClientUserName like '%" & strParm5 & "%') and (DestHost like 'www%')) " & _
         " Order by DestHost "
                     		 
'Response.write strSQL

server.ScriptTimeOut = 600

rst.Open strSQL, con, adOpenKeyset, adLockOptimistic

'Only display records if there are records in the recordset

If NOT rst.EOF then
  'Display the header
%>
<div align="center">

<p align="center"><b>Internet Destinations </b> </p>

<p align="center"><b>from <%=Request.Form("fdate")%></b></p>

<p align="center"><b>thru <%=Request.Form("tdate")%></b> </p>

<p align="center"><b> for <font color="#FF0000"> <%=Request.Form("scname")%></b>
</font></p>

<p align="center"> <b> <font color="#0000FF">Click on the link to view activity</font> </b></p>

<div align="center"><center>

<table BORDER="1" height="57" width="501">
  <tr>
    <td align="center" height="17" width="491"><b>Destinations</b></td>
  </tr>
<%
'Loop through the recordset until there are no more records


Do While Not rst.EOF
%>
<tr>
  <td align="center" height="29" width="491"><a href="InternetDestinations4.asp?Dest=<%=rst("DestHost")%>&From=<%=Request.Form("fdate")%>&Thru=<%=Request.Form("tdate")%>&User=<%=rst("ClientUserName")%>" target="_blank"><%=rst("DestHost")%> 
</td>
 </tr>
<% 

'If you forget this next statement, you will be stuck in a loop
rst.MoveNext

Loop


Else

%>
 
<b>
  <tr>
    <td align="center" height="23" width="491">No records in recordset!  </b>
<%

%>
</td>
    
  </b>
      
<p></p>

      
<p></p>


      
<p></p>



      
<%
End If



rst.Close
con.Close
%></html>

(in reply to rdouglass)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Substring problem/ hyperlink question - 8/8/2005 13:32:44   
quote:

MyVar=request.servervariables("User")


Sorry I didn't catch this in the last post. :) The line should be:

MyVar=request.servervariables("logon_user")

My initial post used it but you must have changed it somewhere. Change that line to what I just posted and see if that makes a diff. If it does, comment out the response.write myUserName and response.end and see how that works.


_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to rdouglass)
rrnml

 

Posts: 197
Joined: 9/20/2004
Status: offline

 
RE: Substring problem/ hyperlink question - 8/8/2005 13:38:11   
I see. Now it displays NMLW2K/rachel

(in reply to rdouglass)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Substring problem/ hyperlink question - 8/8/2005 14:16:26   
quote:

I see. Now it displays NMLW2K/rachel


That get you where you need to be?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to rrnml)
rrnml

 

Posts: 197
Joined: 9/20/2004
Status: offline

 
RE: Substring problem/ hyperlink question - 8/8/2005 14:28:43   
Not quite. This is what displays...

Internet Destinations from 20050804 thru 20050804

www.anywho.com

NMLW2K\rachel

Users Date Time

NMLW2K\rachel 8/4/2005 12:35:10 PM
NMLW2K\rachel 8/4/2005 12:35:11 PM
NMLW2K\rachel 8/4/2005 12:35:12 PM


and this is what I would like to see displayed.

Internet Destinations from 20050804 thru 20050804

www.anywho.com

rachel

Users Date Time

rachel 8/4/2005 12:35:10 PM
rachel 8/4/2005 12:35:11 PM
rachel 8/4/2005 12:35:12 PM

(in reply to rdouglass)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Substring problem/ hyperlink question - 8/8/2005 14:43:07   
quote:

strParm5 = Mid(strParm2,1,7)


Where you have this on the first page, you should be able to just put this:

strParm5 = myUserName

Haven't looked how it affects your other page 'cause I don't know what you posted is from page 1 or 2.

also, you have Request("User") around in places. What is that supposed to do? Are you trying to put the username in there as well?

That help any?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to rrnml)
rrnml

 

Posts: 197
Joined: 9/20/2004
Status: offline

 
RE: Substring problem/ hyperlink question - 8/8/2005 14:49:29   
That's the part that returns the NMLW2K/username

(in reply to rdouglass)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Substring problem/ hyperlink question - 8/8/2005 15:00:23   
quote:

That's the part that returns the NMLW2K/username


I understand that. What I'm saying is that I'm already dealing with it in the script I gave you.

It comes down to an excersize in string manipulation. You have to fix the returned name (that includes the domain) and pass it along.

I've already done that with the variable myUserName but it looks like you're trying to do it all over again. I really don't want to do this for you but rather nudge you in the right direction. :) Wherever you need that on page 1, just use myUserName instead.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to rrnml)
rrnml

 

Posts: 197
Joined: 9/20/2004
Status: offline

 
RE: Substring problem/ hyperlink question - 8/8/2005 15:06:21   
Totally understand what you mean about doing it FOR me. What I meant to say in answer to your question was, yes I am trying to put the user name there as well. But I understand what you're saying about doing it all over again. I'll figure it out and then I'll come back regarding the redirect to another url. Thanks so much for your help though.

(in reply to rdouglass)
rrnml

 

Posts: 197
Joined: 9/20/2004
Status: offline

 
RE: Substring problem/ hyperlink question - 8/9/2005 12:04:19   
Ok so I figured it out! Thanks for not doing it FOR me by the way. So now all I need to work on is getting my link to redirect to the actual site. I noticed this website has something similar. Looks like there is a redirect_url.asp page that directs it to the actual site. Can you help with this rdouglass?

(in reply to rrnml)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Substring problem/ hyperlink question - 8/9/2005 12:29:17   
quote:

Can you help with this rdouglass?


I'll sure give it a shot. :)

Where does the URL come from? Is it from the DB?

Are you trying to do it right here?

<a href="InternetDestinations4.asp?Dest=<%=rst("DestHost")%>&From=<%=Request.Form("fdate")%>&Thru=<%=Request.Form("tdate")%>&User=<%=rst("ClientUserName")%>" target="_blank"><%=rst("DestHost")%>

If that's the case, what happens if you just close the href tag (doesn't seem like it is currently) like so?

<a href="InternetDestinations4.asp?Dest=<%=rst("DestHost")%>&From=<%=Request.Form("fdate")%>&Thru=<%=Request.Form("tdate")%>&User=<%=rst("ClientUserName")%>" target="_blank"><%=rst("DestHost")%> </a>

Does it link? If not, what displays if anything?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to rrnml)
rrnml

 

Posts: 197
Joined: 9/20/2004
Status: offline

 
RE: Substring problem/ hyperlink question - 8/9/2005 12:39:18   
Actually this is where it's being done... It does link but what displays in the address bar is http://internal/Queries/www.nmcourts.com

internal being our intranet

Also I get the page not found error obviously because there is no www.nmcourts.com in our Queries folder! This code can be found on the other page I posted.


<b><p align="center"><b>  <font color="#FF0000"><a href="<%=Request("Dest")%>" target="_blank"><%=Request("Dest")%></a></b></p></font></b>


(in reply to rdouglass)
rrnml

 

Posts: 197
Joined: 9/20/2004
Status: offline

 
RE: Substring problem/ hyperlink question - 8/9/2005 12:45:29   
Oh yeah and I closed the the hyperlink tag and nothing changed. Didn't even realize it wasn't closed. Thanks!

(in reply to rrnml)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Substring problem/ hyperlink question - 8/9/2005 14:49:57   
quote:

<b><p align="center"><b> <font color="#FF0000"><a href="<%=Request("Dest")%>" target="_blank"><%=Request("Dest")%></a></b></p></font></b>


So what gets written to the browser when you change it to this:

<b><p align="center"><b> <font color="#FF0000"><%=Request("Dest")%></b></p></font></b>

That should just write what's in the DB. If it's not what you expect, check the db to see if it is valid data.

That get you any closer?



_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to rrnml)
rrnml

 

Posts: 197
Joined: 9/20/2004
Status: offline

 
RE: Substring problem/ hyperlink question - 8/9/2005 14:55:23   
It writes the www.nmcourts.com but with no hyperlink. I want to be able to click on it and have it go to www.nmcourts.com

(in reply to rdouglass)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Substring problem/ hyperlink question - 8/9/2005 15:32:53   
quote:

<b><p align="center"><b> <font color="#FF0000"><%=Request("Dest")%></b></p></font></b>


I see what's happening now. Try it this way:

<b><p align="center"><b> <font color="#FF0000"><a href="http://<%=Request("Dest")%>"><%=Request("Dest")%></a></b></p></font></b>

It looks like there is no "http://" in the links. That code should work unless there are some. If so, we'd have to put an IF...THEN in there to check for it.

That get you any closer?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to rrnml)
rrnml

 

Posts: 197
Joined: 9/20/2004
Status: offline

 
RE: Substring problem/ hyperlink question - 8/9/2005 15:40:47   
Awesome. You're the man! I thank you so much for your help. It is very much appreciated!!!!!!!!!!!!!!!!

(in reply to rdouglass)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Substring problem/ hyperlink question
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts