🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.web
6 messages
6 total messages Started by Ted Tripp Tue, 01 Feb 2005 21:38
Fully qualified path
#1389
Author: Ted Tripp
Date: Tue, 01 Feb 2005 21:38
12 lines
1223 bytes
I am looking for a function that would do something like this:

String asURLFullyQualifiedPath = GetFullyQualifiedPath(String asLink, String 
asCurrentURL);

where the asLink might be a relative path to asCurrentURL.

Thought it would be easy to put together, but the real-life permutations are 
giving me headaches.

Thanks
Ted 
Re: Fully qualified path
#1390
Author: Remy Lebeau (TeamB)
Date: Tue, 01 Feb 2005 22:15
24 lines
1441 bytes
"Ted Tripp" <ttripp@rankexec.com> wrote in message
news:41fff6f1$1@newsgroups.borland.com...
> I am looking for a function that would do something like this:
>
> String asURLFullyQualifiedPath = GetFullyQualifiedPath(String asLink,
String
> asCurrentURL);
>
> where the asLink might be a relative path to asCurrentURL.

You did not say where the values are coming from to begin with.

The WinInet API has a InternetCombineUrl() function.

Indy has a ProcessPath() function.

> Thought it would be easy to put together, but the real-life
> permutations are giving me headaches.

Such as?


Gambit
Re: Fully qualified path
#1392
Author: Ted Tripp
Date: Tue, 01 Feb 2005 22:48
36 lines
2065 bytes
Thanks, I think the ProcessPath is just what I'm looking for.  To answer 
your question, the asLink would be on whatever the current document page is, 
asCurrentURL, in other words the address you would find in internet explorer 
when looking at the link on a page.

Thanks
Ted

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:41fffeca$1@newsgroups.borland.com...
>
> "Ted Tripp" <ttripp@rankexec.com> wrote in message
> news:41fff6f1$1@newsgroups.borland.com...
>> I am looking for a function that would do something like this:
>>
>> String asURLFullyQualifiedPath = GetFullyQualifiedPath(String asLink,
> String
>> asCurrentURL);
>>
>> where the asLink might be a relative path to asCurrentURL.
>
> You did not say where the values are coming from to begin with.
>
> The WinInet API has a InternetCombineUrl() function.
>
> Indy has a ProcessPath() function.
>
>> Thought it would be easy to put together, but the real-life
>> permutations are giving me headaches.
>
> Such as?
>
>
> Gambit
>
> 
Re: Fully qualified path
#1391
Author: Remy Lebeau (TeamB)
Date: Tue, 01 Feb 2005 22:56
15 lines
1524 bytes
"Ted Tripp" <ttripp@rankexec.com> wrote in message
news:4200074a$1@newsgroups.borland.com...

> the asLink would be on whatever the current document page is,
> asCurrentURL, in other words the address you would find in internet
> explorer when looking at the link on a page.

The browser will already handle qualifying the path BEFORE sending it to the
HTTP server.  The browser knows what its current URL is and what URL is
being requested.  The requests that are sent to the HTTP server are already
qualified to begin with.


Gambit
Re: Fully qualified path
#1393
Author: Ted Tripp
Date: Tue, 01 Feb 2005 23:30
49 lines
2944 bytes
Yes, your right, but that is not the scenario I'm working with.  I am 
running pHTTP in multiple threads, am storing the parent URL to a table and 
coming back to it later to possibly analyze the links found in the HTML that 
I previously cached to a memo field.  What I am left with at that point is 
the Parent URL, Host(which in this case would seem to be no help) and the 
link information which may or may not be relative, or may be an external 
link.  I would rather combine the parent and link rather than tie up 
bandwidth making a second call to the parent to reestablish a path with the 
server.

Played with the ProcessPath a little bit and it doesn't seem to be a 
complete solution, but does get me halfway there.  It doesn't recognize 
external links and simply appends them to the parent link:

ProcessPath("http://www.widgets.com/products.html", 
"http"//www.anotherwidget.com/html", "/"); will combine as 
"http://www.widgets.com/products.html/http:/www.anotherwidget.com/html"

.  It does seem to take care of all that nasty relative stuff that occurs 
within the host however.  So I should only need to determine whether or not 
it's an external link and move on.

Thanks
Ted




"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:4200085b$1@newsgroups.borland.com...
>
> "Ted Tripp" <ttripp@rankexec.com> wrote in message
> news:4200074a$1@newsgroups.borland.com...
>
>> the asLink would be on whatever the current document page is,
>> asCurrentURL, in other words the address you would find in internet
>> explorer when looking at the link on a page.
>
> The browser will already handle qualifying the path BEFORE sending it to 
> the
> HTTP server.  The browser knows what its current URL is and what URL is
> being requested.  The requests that are sent to the HTTP server are 
> already
> qualified to begin with.
>
>
> Gambit
>
> 
Re: Fully qualified path
#1394
Author: Remy Lebeau (TeamB)
Date: Wed, 02 Feb 2005 01:25
17 lines
1616 bytes
"Ted Tripp" <ttripp@rankexec.com> wrote in message
news:4200111a$1@newsgroups.borland.com...

> Played with the ProcessPath a little bit and it doesn't seem to
> be a complete solution, but does get me halfway there.  It
> doesn't recognize external links and simply appends them to
> the parent link

ProcessPath() was not designed to be used with HTTP URLs, so you will have
to finess the strings a bit before calling ProcessPath().

You never did answer my original question - why are you having problems
putting together links on your own?


Gambit
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads