1. Main function

Ok. First and main function is this:

function url( $atts, $content = null ) {
return '<a href="/url/?iframe='.$content.'" target="_blank">'.$content.'</a>';
}
add_shortcode("url", "url");

And I use: [url]https://stackoverflow.com/[/url]

It returns:

<a href="/url/?link=https://stackoverflow.com/" target="_blank">https://stackoverflow.com/</a>

2. Agreement function

When is clicked it sends user to agreement to proceed:

function url_proceed( $atts, $content = null ) {
$url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$url = str_replace('url', 'url.php', $url);
return '<a href="'.$url.'">Proceed</a>';
}
add_shortcode("url_proceed", "url_proceed");

This shortcode is placed on page with name and tag: url, as function says.

and this would send user to final destination:

<a href="/url.php/?iframe=https://stackoverflow.com/" target="_blank">Proceed</a>

3. Final destination

url.php is in root, with content:

<iframe src="<?php echo $_GET['iframe']; ?>" width="100%" height="100%" frameborder="0" scrolling="yes"></iframe>

4. Address bar

In address bar in all steps I have ?iframe=https://stackoverflow.com/

  1. http://domain.com/url/?iframe=https://stackoverflow.com/

  2. http://domain.com/url.php/?iframe=https://stackoverflow.com/

In address bar I want this ?iframe=https://stackoverflow.com/ to be like this ?iframe=encrypted/obfuscated, or to remove it but still to be able and used by $_GET

Please if someone know solution, I will be thankfull.

I know inspect element will still show source of iframe, but it looks more nice if there is no this holder shown.

有帮助吗?

解决方案

you can use Base64 encode with:

base64_encode

url:

?iframe=aHR0cDovL3N0YWNrb3ZlcmZsb3cuY29tLw==

and then decode with:

base64_decode

and on the page that receives the parameter you decode

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top