you can use Base64 encode with:
url:
?iframe=aHR0cDovL3N0YWNrb3ZlcmZsb3cuY29tLw==
and then decode with:
and on the page that receives the parameter you decode
Question
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/
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.
Solution
you can use Base64 encode with:
url:
?iframe=aHR0cDovL3N0YWNrb3ZlcmZsb3cuY29tLw==
and then decode with:
and on the page that receives the parameter you decode