samUK Posted July 22, 2008 Share Posted July 22, 2008 Hi ive been racking my brain all day. Im pretty new to this aswell so bear with me. I have created an update page. I am pulling out info from my database and placing it in a table so it can be updated. Now, I have a mixture of images and swfs, so i have inserted in my database entries such as, <img src="images/HME.jpg" /> When i pull this out in to a table, and view in my browser window i get this, I understand the /> at the end of the image address interferes with the actual html table, <td>Image 1:</td> <td><input type="text" name="img1" value="<?php echo $row_Recordset1['img1']; ?>" size="50"></td> I have this bit of code at the top of my file and was wandering if this has anything to do with it, $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; PLEASE PLEASE SOMEONE HELP!! Link to comment https://forums.phpfreaks.com/topic/116048-separating-html-from-php-newbie/ Share on other sites More sharing options...
DarkWater Posted July 22, 2008 Share Posted July 22, 2008 Use htmlentities($string, ENT_QUOTES); And why are you storing it with the HTML? You should just add a field to determine a SWF or image and output the correct HTML accordingly. Link to comment https://forums.phpfreaks.com/topic/116048-separating-html-from-php-newbie/#findComment-596722 Share on other sites More sharing options...
samUK Posted July 22, 2008 Author Share Posted July 22, 2008 Thank you very much for you reply, Now as i said, im a newb and i do not understand where to use, Use htmlentities($string, ENT_QUOTES); As for adding a field to determine a swf or image, i never knew you could do that, and am a little confused about how id go about doing it? Your help and advice is much appreciated, thanks, Sam Link to comment https://forums.phpfreaks.com/topic/116048-separating-html-from-php-newbie/#findComment-596742 Share on other sites More sharing options...
natbob Posted July 22, 2008 Share Posted July 22, 2008 I'm not sure of your database design or source if img/swf's but strstr('.swf', $myFileName) would work. Then you would add a new column in your database and display accordingly. Link to comment https://forums.phpfreaks.com/topic/116048-separating-html-from-php-newbie/#findComment-596947 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.