wintallo Posted January 31, 2007 Share Posted January 31, 2007 Hey,How can I make it so full HTML code (with quotes and everything) can be stored in a PHP variable.This is the kind of HTML i will be storing is[code]<object height="525" width="700"><param name="movie" value="../game-movie/motion.swf" /><embed src="../game-movie/motion.swf" height="525" width="700"></object>[/code] or maybe [code]<embed style="width: 400px; height: 326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=4092819850988013212" quality="best" bgcolor="#ffffff" scale="noScale" salign="TL" flashvars="playerMode=embedded" align="center">[/code]I tried this[code]<?php$moviehtml = addslashes( "<object height="525" width="700"><param name="movie" value="../game-movie/motion.swf" /><embed src="../game-movie/motion.swf" height="525" width="700"></object>" );echo $moviehtml;echo "testing...";?>[/code]But it doesn't even output the "testing..." Thanks for the read and if you don't get what I'm saying, please reply.-Joel Quote Link to comment https://forums.phpfreaks.com/topic/36423-html-in-php-variables/ Share on other sites More sharing options...
corbin Posted January 31, 2007 Share Posted January 31, 2007 Add slashes doesn't work like that :(...It would cause an error because of the quotes... I suggest something like$moviehtml = '<object height="525" width="700"><param name="movie" value="../game-movie/motion.swf" /><embed src="../game-movie/motion.swf" height="525" width="700"></object>';Or if your variable is going to have single quotes, I suggest using $tag = "<htmltag var=\"val\">"; Quote Link to comment https://forums.phpfreaks.com/topic/36423-html-in-php-variables/#findComment-173282 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.