jasonc Posted June 10, 2011 Share Posted June 10, 2011 I am trying to get the actual returns to show in the form fields and not the <br> i have the form read the field and convert \r\n to <br> to store in the database, but when the i have the form shown later on with the content of the database it shows the <br> and not the newlines like it was entered each on a seperate line. Link to comment https://forums.phpfreaks.com/topic/238965-echo-returns-in-form-field-not-the/ Share on other sites More sharing options...
trq Posted June 10, 2011 Share Posted June 10, 2011 Don't convert newlines to <br /> when storing in the database, only when you need to display your data within html. Link to comment https://forums.phpfreaks.com/topic/238965-echo-returns-in-form-field-not-the/#findComment-1227869 Share on other sites More sharing options...
jasonc Posted June 10, 2011 Author Share Posted June 10, 2011 actually i was not converting them before inserting, i am converting them before displaying. but i get the <br> show in the form field and not the return (next line) all the text shows on the same line with <br> between all the text instead of on each line as it was typed Link to comment https://forums.phpfreaks.com/topic/238965-echo-returns-in-form-field-not-the/#findComment-1227871 Share on other sites More sharing options...
trq Posted June 10, 2011 Share Posted June 10, 2011 Then your data must contain the <br> tags. Link to comment https://forums.phpfreaks.com/topic/238965-echo-returns-in-form-field-not-the/#findComment-1227874 Share on other sites More sharing options...
jasonc Posted June 10, 2011 Author Share Posted June 10, 2011 ok my data is added to the database using the mysql_real_escape_string method and when the data is got back later on and displayed it shows the \r\n, so i have these converted to <br> but what ever i use i get either \r\n or <br> and not a return in the textarea Link to comment https://forums.phpfreaks.com/topic/238965-echo-returns-in-form-field-not-the/#findComment-1227885 Share on other sites More sharing options...
jasonc Posted June 10, 2011 Author Share Posted June 10, 2011 i seem to have solved this by not converting anything and leaving it as it is shown in the database, not sure what else i done to get this to work but now the returns are showing like they were typed in. BUT... i have the other problem of the £ not showing in the emails as a £ it is shown as £ how do i get this character to show only as £ and not £ Link to comment https://forums.phpfreaks.com/topic/238965-echo-returns-in-form-field-not-the/#findComment-1227887 Share on other sites More sharing options...
jasonc Posted June 10, 2011 Author Share Posted June 10, 2011 my emails have the following format... <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> the body of the email that contains the £ sign </body> </html> but the email shows all the £ as £ Link to comment https://forums.phpfreaks.com/topic/238965-echo-returns-in-form-field-not-the/#findComment-1227889 Share on other sites More sharing options...
jasonc Posted June 10, 2011 Author Share Posted June 10, 2011 i echo the email on the page before the email is sent and it also shows the �£12 Link to comment https://forums.phpfreaks.com/topic/238965-echo-returns-in-form-field-not-the/#findComment-1227892 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.