RE: [PHP] Array & Javascript?

From: Date: Fri, 27 Apr 2001 03:10:45 +0000
Subject: RE: [PHP] Array & Javascript?
Groups: php.general 
Request: Send a blank email to php-general+get-50555@lists.php.net to get a copy of this message
STRIPSLASHES(); use single quotes for the array. add the slashes in front each JS's single quote, when echoing use : echo stripslashes($js); Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) maxim@phpbeginner.com www.phpbeginner.com -----Original Message----- From: Marcus Ouimet [mailto:marcus@webpagescanada.com] Sent: Friday, April 27, 2001 6:58 AM To: php-general@lists.php.net Subject: [PHP] Array & Javascript? I am trying to add a Javascript in array but it gives me an error unless certain characters are commented which makes sense, but then the Javascript won't run. Any ideas here is what I am trying: <? $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => ' <A HREF="test.html" onmouseover="document.images[0].src='test1'.jpg; return true;"> <IMG SRC="images/reviews.jpg" BORDER=0></A>'); of course the ' characters are a problem etc. so for an example I tried: <? $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => ' <A HREF="test.html" onmouseover="document.images[0].src=\'test1\'.jpg; return true;"> <IMG SRC="images/reviews.jpg" BORDER=0></A>'); Any suggestions on how to get this to work? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#50555) next »