I have a website where users can e-mail advertisers via a form on the advert. The contents of the message are then e-mailed to to the advertiser.
However, there are problems with the formatting:
[ol][li]apostrophes show as /’ (e.g. I/'m)[/li]
[li]returns don’t work so there are no blank lines between paragraphs[/li]
[li]if the & sign is used, anything after this is not e-mailed[/li][/ol]
Here is the code of the form (I have deleted irrelevant data and changed name of site for privacy)
[php] 1 <?
2 session_start();
3 include “includes/config.php”;
4 include_once(“includes/classes.php”);
5 include_once(“includes/functions.php”);
6 include_once(“includes/page.inc.php”);
7 include(‘includes/mimemail.inc.php’);
8 include(‘includes/function.resize.php’);
9 $obj_db=new DB();
10 $obj_db->open();
11 $page=new page();
12 include_once(“includes/variables.php”);
13 $userid=$_SESSION[‘USERID’];
14 $userid=$_REQUEST[‘userID’];
15
16
17 $sql_advertiser=“select *,DATE_FORMAT(FROM_DAYS(TO_DAYS(NOW())-TO_DAYS(dob)), ‘%Y’)+0 AS age from tbl_signup_user WHERE userID=’”.$userid."’";
18 $rs_advertiser=mysql_query($sql_advertiser);
19 $advertiser_data=mysql_fetch_array($rs_advertiser);
20 $user_name=$advertiser_data[‘user_name’];
21 $settings = array(‘w’=>155,‘h’=>185,‘canvas-color’=>’#ffffff’);
22 $settings2 = array(‘w’=>345,‘h’=>396,‘canvas-color’=>’#ffffff’);
23 ?>
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45 <? include "includes/header.php";?>
46
47
48
49
50
51
Email me
52
53
54
55 Your name :
56
57
58
59
60
61 Your e-mail :
62
63
64
65
66
67 Your message :
68
69
70
71
72
73 Enter the text
74 in the box :
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99 <? include "includes/footer.php";?>
100
101
157
158
159 [/php]
Here is the html of the text we add to the message:
1 <img src="http://mysite.co.uk/images/logo.png" border="0"><br /><br />
2 Hi --first_name--,<br /><br />
3
4 The message below was sent to you via your --user_name-- profile on the www.mysite.co.uk website. Hit reply on your e-mail to contact the sender directly.<br /><br />
5
6
7
8 Here is the message : <br />
9
10 From: --name--<br />
11 Message: --message--
12
13 <br /><br />
14
15
16 Thanks, <br />
17 My Site Support
Does anyone have any idea please why the formatting is wrong and how I correct it?
Thanks