Re: Re: Can it be Done?
| From: | Sascha Cunz | Date: | Sun, 06 Oct 2002 22:01:21 +0000 |
| Subject: | Re: Re: Can it be Done? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-119015@lists.php.net to get a copy of this message | ||
should be interchangeable.
When i wrote this, i didn't want to show the real url up in browser, so i used
base64 encoding.
Sascha
Am Sonntag, 6. Oktober 2002 23:52 schrieb Adriano:
> I understand and thank you Sascha.
> Curiosity: why do you use the 'base64_encode' function to send querystring
> arguments? I'd rather used urlencode...
>
> "Sascha Cunz" <Sascha@GaNoAn.org> ha scritto nel messaggio
> news:200210062210.59157.Sascha@GaNoAn.org...
> To produce such a JavaScript:
>
> define('_DOMBASE',
> 'http://yourdomain.com');
>
> echo '<SCRIPT language="JavaScript"
> type="text/javascript">'."\n"
> .'if (document.location == top.location)'."\n"
> .' top.location="'._DOMBASE.'/index.php?goto='
> .base64_encode($_SERVER["REQUEST_URI"]).'";'."\n"
> .'</SCRIPT>';
>
> where the index.php works like:
>
> <? if (!isset($_GET['goto']))
> $goto = "home.php"; else
> $goto = base64_decode($_GET['goto']);
> ?>
> <FRAMESET>
> <someframes>
> <FRAME src="http://yourdomain.com/<? echo $goto;
> ?>">
> </FRAMESET>
>
> As Stephen reported me recently, this also works with iframes.
>
> Sascha
>
> Am Sonntag, 6. Oktober 2002 21:37 schrieb Adriano:
> > Hi people,
> >
> > @ Edwin wrore:
> > > 'Not really sure, but perhaps, with Javascript.
> > >
> > > But I'd rather recommend you to give up iframes... ;)
> >
> > Can you post an example of Javascript code checking for _parent frame?
> > By the way, what's wrong with iframes?
> > bye,
> > Adr