[PHP] passing variables in javascript
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:+Opening+Moves+in+the+Gameurl=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
Re: [PHP] passing variables in javascript
From: "Nicholas W. Miller" [EMAIL PROTECTED] 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+Gameurl=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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Fwd: Re: [PHP] passing variables in javascript
H ... is there anyway to do this without requiring the page with the link to use PHP? 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: Re: [PHP] passing variables in javascript
From: "Nicholas W. Miller" [EMAIL PROTECTED] H ... is there anyway to do this without requiring the page with the link to use PHP? Well if the string you're going to urlencode() is always going to be the same, then just run it through once, grab the encoded version and hard-code it :) 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]