Re: passing variables in javascript

From: Date: Fri, 23 Feb 2001 03:26:39 +0000
Subject: Re: passing variables in javascript
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-41254@lists.php.net to get a copy of this message
From: "Nicholas W. Miller" <nick@webzeit.com> > I have a text link that is coded to open a PHP file in a popup window: > > <a > href="#"onClick="MM_openBrWindow('../email/popup.php?title=B2B+Antitrust:+Op ening+Moves+in+the+Game&url=http://www.domain.com/biz/pubs.html#antitrust',' email','width=410,height=435')">Emailthis > article</a> > > For some reason the $url variables cuts off the anchor, so I only get this: > > $url = http://www.dttgfsi.com/ebiz/pubs_eviews.html > > I have tried escaping it (\#antitrust), but the doesn't work. > > Any suggestions would be appreciated ... > > Nick > You have to encode each part of the query string on the URL correctly: <a href="#" onClick="MM_openBrWindow('../email/popup.php?<?php echo "title=" . urlencode("B2B Antitrust: Opening Moves in the Game") . "&url=" . urlencode("http://www.domain.com/biz/pubs.html#antitrust"); ?>', 'email','width=410,height=435')">Emailthis</a> Cheers Simon Garner

« previous php.general (#41254) next »