Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Trimming filename and paramters from a URL (output from DB)

Reply
Thread Tools

Trimming filename and paramters from a URL (output from DB)

 
 
Simon
Guest
Posts: n/a
 
      10-28-2004
Hi there.

I seem to be a flurry of questions here recently, thanks for you help all,
but ... got another question here.

I am storing URL in a database for a 'sort of' directory type website.

The <a href> is built from the recordset of URL's which is all working no
problem, easy stuff.

What I have found is going to be necessary in some cases is to trim the URL
back to just it's www.abc.co.uk address for the link display.

I still want the actual link to go to it's long 'deep linking' location, but
there is limited room for displaying a URL that could be a hundred chars
long.

So... Just to recap.

http://www.abc.co.uk/products.asp?ca...methingelse=12

gets trimmed back to

www.abc.co.uk

Thanks in advance.

Simon.


 
Reply With Quote
 
 
 
 
Simon
Guest
Posts: n/a
 
      10-28-2004
I got

I realised I was trimming the http:// from the inputted URL, so I only had
to search for the first / and stop there.

<%

if not rs("URL")="" then

iURL = instr(rs("URL"), "/")
if iURL then tURL = left(rs("URL"), iURL-1) else tURL = rs("URL")
fURL = tURL


%><strong>Website</strong> : <a href="http://<%= rs("URL") %>"
title="<%= fURL %>"><%= fURL %></a><br /><% end if %>

Take care

Si


"Simon" <(E-Mail Removed)> wrote in message
newso9gd.167513$(E-Mail Removed) o.uk...
> Hi there.
>
> I seem to be a flurry of questions here recently, thanks for you help all,
> but ... got another question here.
>
> I am storing URL in a database for a 'sort of' directory type website.
>
> The <a href> is built from the recordset of URL's which is all working no
> problem, easy stuff.
>
> What I have found is going to be necessary in some cases is to trim the

URL
> back to just it's www.abc.co.uk address for the link display.
>
> I still want the actual link to go to it's long 'deep linking' location,

but
> there is limited room for displaying a URL that could be a hundred chars
> long.
>
> So... Just to recap.
>
> http://www.abc.co.uk/products.asp?ca...methingelse=12
>
> gets trimmed back to
>
> www.abc.co.uk
>
> Thanks in advance.
>
> Simon.
>
>



 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      10-28-2004
Simon wrote on 28 okt 2004 in microsoft.public.inetserver.asp.general:
> trimming the http:// from the inputted URL



fURL = replace(rs("URL"),"http://","/")

or

fURL = replace(rs("URL"),"http:/","")

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help needed passing paramters to ActiveX control in HTML page Bob Hanson ASP .Net 2 03-02-2005 12:00 AM
Help trimming URL path =?Utf-8?B?Q2hyaXM=?= ASP .Net 4 12-14-2004 06:56 PM
Struts bean include forward with paramters? Robert Bowen Java 0 06-22-2004 09:11 AM
How to retrieve the homepage filename when filename doesn't exist in URL Diarmaid Javascript 3 05-12-2004 03:28 PM
Web Service with complex paramters and return types J.Marsch ASP .Net Web Services 1 11-14-2003 02:31 AM



Advertisments