How to safely construct URL link in the Notifying message when you don't know your domain name?

StackOverflow https://stackoverflow.com/questions/22240654

  •  10-06-2023
  •  | 
  •  

문제

Here is the problem, I am building a retail site using Gwt. My system has a private in-house message box system.

When customer successfully ordered an item, my system will send a notification (including a link to let user view orders in the order page, ex: "abc.com#!order;orderID=61") to the user's private in-house message box & to the user's email.

-When sending to "the user's private in-house message box" we don't need to know the domain in advanced co the user already staying my website so the link could mist the domain part like this "#!order;orderID=61".

My question is "How to safely construct the URL link in the Notifying message when you don't know your domain name?"

도움이 되었습니까?

해결책

You use a backslash '/' to create a relative link:

<a href="/?orderID=61">This is your order</a>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top