graham23s Posted August 26, 2008 Share Posted August 26, 2008 Hi Guys, When i upload a new product i have the data displayed underneath so you can delete it, if you want! but the data displays like: Lanacane Anti-Chafing Gel, relieves and prevents soreness from rubbing skin and skin on clothing.<br />\r\nUnique barrier against friction.<br />\r\nSilky finish - dries on contact.<br />\r\nNon-greasy, non-staining and fragrance free.<br />\r\nLanacane Anti-chafing Gel forms a breathable barrier on your skin, to prevent and aid healing of chafing caused by repeated rubbing of skin on skin or clothing. <br />\r\n<br />\r\nUnique anti-friction formula dries on contact, clear, non-greasy, providing your skin with long lasting relief. <br />\r\n<br />\r\nGentle enough to use anywhere, everyday. <br />\r\n<br />\r\nDirections: A small amount of Lanacane Anti-Chafing Gel goes a long way.<br />\r\nSmooth a small dab on irritated area.<br />\r\nRe-apply if needed.<br />\r\nTo avoid future chafing, apply prior to activity.<br />\r\nIf pain from soreness and rubbing extends 7 days, consult doctor. For external use only. <br />\r\n<br />\r\nIngredients: <br />\r\nCyclopentasiloxane • Dimethicone Crosspolymer • Vinyl Dimethicone Crosspolymer • Zea Mays (Corn starch). instead of niceley formatted i did: <?php print("<table width='95%' border='0' cellpadding='5' cellspacing='1' class='tbl_login'>"); print("<tr>\n"); print("<td colspan='2' align='left' class='c3'><b>Review Product Details</b></td>\n"); print("</tr>\n"); print("<tr class=\"c5\">\n"); print("<td align=\"left\"><img src=\"images/pixel.gif\" width=\"1\" height=\"1\"></td><td align=\"left\"><img src=\"images/pixel.gif\" width=\"1\" height=\"1\"></td>\n"); print("</tr>\n"); print("<tr class=\"c1\">\n"); print("<td width='15%' align='left' class=\"font_for_forms\">Product name:</td><td align='center'><b>$product_name</b></td>\n"); print("</tr>\n"); print("<tr>"); print("<td align='left' class=\"font_for_forms\" valign='top'>Product thumbnail:</td><td align='center' class=\"font_for_forms\"><img src='products/thumbnails/$thumbnail'></td>\n"); print("</tr>\n"); print("<tr class=\"c1\">\n"); print("<td align='left' class=\"font_for_forms\" valign='top'>Product fullsize:</td><td align='center' class=\"font_for_forms\"><img src='products/fullsize/$new_image_name'></td>\n"); print("</tr>\n"); print("<tr>\n"); print("<td width='15%' class=\"font_for_forms\" align='left' valign='top'>Product description:</td><td align='left'class=\"font_for_forms\" ><b>" . htmlspecialchars($product_desc) ."</b></td>\n"); print("</tr>\n"); print("<tr class=\"c1\">\n"); print("<td class=\"font_for_forms\" colspan='2' align='right'><input type='submit' name='submit' value='Delete'></td>"); print("</tr>\n"); print("</table>\n"); ?> but that does work! is there another function i should use round the description variable? thanks guys Graham Quote Link to comment Share on other sites More sharing options...
JREAM Posted August 26, 2008 Share Posted August 26, 2008 I cant follow what you are doing, are you not wanting the \r\n's? you might use printf (for print format) or another vprintf or sometihng http://us2.php.net/printf Quote Link to comment Share on other sites More sharing options...
graham23s Posted August 26, 2008 Author Share Posted August 26, 2008 Hi Mate, Yeah, as you can see above it prints the /r/n where as i just wanted it displayed without them kinda thing. Graham Quote Link to comment Share on other sites More sharing options...
richardw Posted August 26, 2008 Share Posted August 26, 2008 <?php $text = "Lanacane Anti-Chafing Gel, relieves and prevents soreness from rubbing skin and skin on clothing.<br />\r\nUnique barrier against friction.<br />\r\nSilky finish - dries on contact.<br />\r\nNon-greasy, non-staining and fragrance free.<br />\r\nLanacane Anti-chafing Gel forms a breathable barrier on your skin, to prevent and aid healing of chafing caused by repeated rubbing of skin on skin or clothing. <br />\r\n<br />\r\nUnique anti-friction formula dries on contact, clear, non-greasy, providing your skin with long lasting relief. <br />\r\n<br />\r\nGentle enough to use anywhere, everyday. <br />\r\n<br />\r\nDirections: A small amount of Lanacane Anti-Chafing Gel goes a long way.<br />\r\nSmooth a small dab on irritated area.<br />\r\nRe-apply if needed.<br />\r\nTo avoid future chafing, apply prior to activity.<br />\r\nIf pain from soreness and rubbing extends 7 days, consult doctor. For external use only. <br />\r\n<br />\r\nIngredients: <br />\r\nCyclopentasiloxane • Dimethicone Crosspolymer • Vinyl Dimethicone Crosspolymer • Zea Mays (Corn starch)."; echo $text ; seems to work. is there any other code used in the output routine? echo "<br><br>" ; echo nl2br($text) ; // provides extra space ?> myouput for the above is respectively: Lanacane Anti-Chafing Gel, relieves and prevents soreness from rubbing skin and skin on clothing. Unique barrier against friction. Silky finish - dries on contact. Non-greasy, non-staining and fragrance free. Lanacane Anti-chafing Gel forms a breathable barrier on your skin, to prevent and aid healing of chafing caused by repeated rubbing of skin on skin or clothing. Unique anti-friction formula dries on contact, clear, non-greasy, providing your skin with long lasting relief. Gentle enough to use anywhere, everyday. Directions: A small amount of Lanacane Anti-Chafing Gel goes a long way. Smooth a small dab on irritated area. Re-apply if needed. To avoid future chafing, apply prior to activity. If pain from soreness and rubbing extends 7 days, consult doctor. For external use only. Ingredients: Cyclopentasiloxane • Dimethicone Crosspolymer • Vinyl Dimethicone Crosspolymer • Zea Mays (Corn starch). --------> with nl2br Lanacane Anti-Chafing Gel, relieves and prevents soreness from rubbing skin and skin on clothing. Unique barrier against friction. Silky finish - dries on contact. Non-greasy, non-staining and fragrance free. Lanacane Anti-chafing Gel forms a breathable barrier on your skin, to prevent and aid healing of chafing caused by repeated rubbing of skin on skin or clothing. Unique anti-friction formula dries on contact, clear, non-greasy, providing your skin with long lasting relief. Gentle enough to use anywhere, everyday. Directions: A small amount of Lanacane Anti-Chafing Gel goes a long way. Smooth a small dab on irritated area. Re-apply if needed. To avoid future chafing, apply prior to activity. If pain from soreness and rubbing extends 7 days, consult doctor. For external use only. Ingredients: Cyclopentasiloxane • Dimethicone Crosspolymer • Vinyl Dimethicone Crosspolymer • Zea Mays (Corn starch). Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 26, 2008 Share Posted August 26, 2008 You're using htmlspecialchars(), which stops all the line breaks from working. Quote Link to comment 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.