jeffmorris81 Posted November 20, 2008 Share Posted November 20, 2008 hello there.. im quite new to php, just learning.. and im have a realy problem with " ' "s!!! here is the code im working on... <?php if (!defined('ANCLPAGE')) { die('Hacking attempt'); exit; } $_T['ancl_welcome'] = '<H3><center>TO THE</center></H3><BR><BR> <H2><center>ALL NATIONS CHESS LEAGUE</center></H2><BR><BR> <H3><center>THE ANCL IS AN ONLINE LEAGUE THAT RUNS ON</center></H3><BR><BR> <center><A href="http://www.playchess.com"><IMG style="width: 30%" src="images/general/playchesslogo1.gif"></A></center><BR><BR> '; the problem is.. i need to insert an .swf to replace <H3><center>TO THE</center></H3><BR><BR> <H2><center>ALL NATIONS CHESS LEAGUE</center></H2><BR><BR> <H3><center>THE ANCL IS AN ONLINE LEAGUE THAT RUNS ON</center></H3><BR><BR> <center><A href="http://www.playchess.com"><IMG style="width: 30%" src="images/general/playchesslogo1.gif"></A></center><BR><BR> but the .swf html code involves many many " ' "s... here is the .swf code... <script language="javascript">AC_FL_RunContent = 0;</script> <script src="AC_RunActiveContent.js" language="javascript"></script> </head> <body bgcolor="#ddeeff"> <!--url's used in the movie--> <!--text used in the movie--> <!-- saved from url=(0013)about:internet --> <script language="javascript"> if (AC_FL_RunContent == 0) { alert("This page requires AC_RunActiveContent.js."); } else { AC_FL_RunContent( 'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0', 'width', '539', 'height', '277', 'src', 'welcome', 'quality', 'high', 'pluginspage', 'http://www.macromedia.com/go/getflashplayer', 'align', 'middle', 'play', 'true', 'loop', 'true', 'scale', 'showall', 'wmode', 'window', 'devicefont', 'false', 'id', 'welcome', 'bgcolor', '#ddeeff', 'name', 'welcome', 'menu', 'true', 'allowFullScreen', 'false', 'allowScriptAccess','sameDomain', 'movie', 'welcome', 'salign', '' ); //end AC code } </script> <noscript> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="539" height="277" id="welcome" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="false" /> <param name="movie" value="welcome.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ddeeff" /> <embed src="welcome.swf" quality="high" bgcolor="#ddeeff" width="539" height="277" name="welcome" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> as you can see, and probably already know..it contains lots of " ' ".. i have no idea how to preceed... please help!!! Link to comment https://forums.phpfreaks.com/topic/133570-help-with-s/ Share on other sites More sharing options...
trq Posted November 20, 2008 Share Posted November 20, 2008 If you want to use ' within a single quoted string you need to escape them using \ (eg; \') else, wrap your string in double quotes, but the same applies, double quotes witll then need to be escaped. oh: and ps. We have tags for use when posting code. Link to comment https://forums.phpfreaks.com/topic/133570-help-with-s/#findComment-694767 Share on other sites More sharing options...
jeffmorris81 Posted November 21, 2008 Author Share Posted November 21, 2008 thank you for the " /' " advice.. i tried it. .but it doesnt seem to work.. here is the code i re-wrote... <?php if (!defined('ANCLPAGE')) { die('Hacking attempt'); exit; } $_T['ancl_welcome'] = '<center> <script language="javascript">AC_FL_RunContent = 0;</script> <script src="AC_RunActiveContent.js" language="javascript"></script> </head> <body bgcolor="#ddeeff"> <!--url/'s used in the movie--> <!--text used in the movie--> <!-- saved from url=(0013)about:internet --> <script language="javascript"> if (AC_FL_RunContent == 0) { alert("This page requires AC_RunActiveContent.js."); } else { AC_FL_RunContent( /'codebase/', /'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0/', /'width/', /'539/', /'height/', /'277/', /'src/', /'../flash/welcome/', /'quality/', /'high/', /'pluginspage/', /'http://www.macromedia.com/go/getflashplayer/', /'align/', /'middle/', /'play/', /'true/', /'loop/', /'true/', /'scale/', /'showall/', /'wmode/', /'window/', /'devicefont/', /'false/', /'id/', /'welcome/', /'bgcolor/', /'#ddeeff/', /'name/', /'welcome/', /'menu/', /'true/', /'allowFullScreen/', /'false/', /'allowScriptAccess/',/'sameDomain/', /'movie/', /'../flash/welcome/', /'salign/', /'/' ); //end AC code } </script> <noscript> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="539" height="277" id="welcome" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="false" /> <param name="movie" value="../flash/welcome.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ddeeff" /> <embed src="../flash/welcome.swf" quality="high" bgcolor="#ddeeff" width="539" height="277" name="welcome" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> </center> '; and i get an error message saying: Parse error: syntax error, unexpected T_STRING in /home/anclches/public_html/languages/lang_en.php on line 14 Link to comment https://forums.phpfreaks.com/topic/133570-help-with-s/#findComment-694795 Share on other sites More sharing options...
flyhoney Posted November 21, 2008 Share Posted November 21, 2008 Those slashes are the wrong way. <?php $string = 'this string has escaped \' apostrophe\'s'; // is the same as $string = "this string has escaped ' apostrophe's"; ?> Link to comment https://forums.phpfreaks.com/topic/133570-help-with-s/#findComment-694804 Share on other sites More sharing options...
trq Posted November 21, 2008 Share Posted November 21, 2008 Its \ not / Link to comment https://forums.phpfreaks.com/topic/133570-help-with-s/#findComment-694805 Share on other sites More sharing options...
jeffmorris81 Posted November 21, 2008 Author Share Posted November 21, 2008 THANK YOU SOOOOOO MUCH.. i spent hours and hourrrrrrrrrs over that.. now its finally working.. learning php is not easy!!! and it is great that there are people out there who are willing to share their knowledge.. when im a pro.. i will be helping out people in this very forum.. :) :) Thanks again Link to comment https://forums.phpfreaks.com/topic/133570-help-with-s/#findComment-694822 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.