Avatar of lebron letchev
lebron letchev

asked on 

How Get the absolete URL from a relative url placed into a input form?

Dear all,

Could I get the absolute url from a relative url placed into an input form?

Example:

Input text = "www.elmundo.es"
absolute url = https://www.elmundo.es

Input text = "w3guy.com/relative-absolute-url-guide/"
absolute url = https://w3guy.com/relative-absolute-url-guide/

Input text = "www.filosofia.org/rev/bas/"
absolute url = http://www.filosofia.org/rev/bas/

There are dozens of solutions to get absolute url from a relative url on address bar (the url of the open page), but not from an input form.

I just make a question ultimately!

Could someone help me to find a solution for this case

Thanks
ASPJavaScriptPHP

Avatar of undefined
Last Comment
lebron letchev
ASKER CERTIFIED SOLUTION
Avatar of David S.
David S.
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of leakim971
leakim971
Flag of Guadeloupe image

adding asp and php topics, you finally answered me in your previous question
you just need to read the header using server code and see if you get a http 301 redirect code (maybe you to handle 302) and check if the new location start by "https" with the same address
Avatar of lebron letchev
lebron letchev

ASKER

Hello,

I have a problem in programming! Formerly the languages had little more than 100 commands and functions, in the old days of the turbo pascal, but, today they are thousands and I do not know how to DECORATE ALL !!!

I am working with with 2 files. The first one with a input form and the 2nd in asp classic with Server.CreateObject ("Microsoft.XMLHTTP") and the script of the .asp file does not accept another url that the absolute url. For example:

the absolute url http://www.elmundo.es gives an error: msxml3.dll error '80070005'

It accepsts only the absolute ands correct url https://www.elmundo.es

And does not redirect the 'wrong' url to correct and current url

Yes, the asp classic and PhP have more options to answer this question, but I need reading and try the available codes to see if I could "rewrite" them

PS: Unfortunately due this 'problem" I could not to do the academic course I love because it have the logic program discipline!!!
Thank you in advance
Avatar of lebron letchev
lebron letchev

ASKER

Dear David S.

In another case I have 1 file in .asp and another in .php. Yes. "they working fine".

This script may be useful: LINK TO CONCURRENT SITE REMOVED

I will search for more to see if I find a code more simple and easy to rewrite it.

thanks by now
Avatar of lebron letchev
lebron letchev

ASKER

Hello, If  I sign up yours solve my question (and other) with a reasonale answer?
Avatar of lebron letchev
lebron letchev

ASKER

Many thanks
JavaScript
JavaScript

JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.

127K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo