所以我建立了一个php联系页面,这是我遇到问题的php的一部分。
$body_message ='Application from '.$field_name."\r\n";
$body_message ='Name: ' .$field_name."\r\n";
$body_message ='Email: ' .$field_email."\r\n";
$body_message ='Age: ' .$field_age."\r\n";
$body_message ='Username: ' .$field_usname."\r\n";
$body_message ='Timezone: ' .$field_timezone."\r\n";
$body_message ='Experience: ' .$field_exp."\r\n";
$body_message ='KSP Experience: ' .$field_expksp."\r\n";
$body_message ='Computer Specs: ' .$field_specs."\r\n";
$body_message ='Download Speed: ' .$field_download."\r\n";
$body_message ='Upload Speed: ' .$field_upload."\r\n";
$body_message ='How can they contribute?: ' .$field_contrib."\r\n";
$body_message ='How do they standout?: ' .$field_standout."\r\n";
$body_message ='What is their strengths and weaknesses as a: ' .$field_procon."\r\n";
$body_message ='How can they contribute after the competition?: ' .$field_contribafter."\r\n";
$body_message .='Their schedule: ' .$field_schedule;
电子邮件中显示的唯一代码是最后两项。那么我该如何解决这个问题呢。是否有很多$ body_messages?我希望换行符有“\ r \ n”。有人能告诉我在哪里搞砸了吗?
答案 0 :(得分:4)
要连接所有这些字符串,您需要在第一个之后为每行设置$body_message .=
。您当前正在将$body_message
设置为倒数第二个字符串,然后将其连接到最后一个字符串。
请参阅docs
答案 1 :(得分:0)
示例:
$ messagework =“姓名:”。$ name;
$ messagework。=“。学校:”。$ school;
$ messagework。=“。地址:”。$ address;
$ messagework。=“。电子邮件:”。$ email;
$ messagework。=“。电话:”。$ phone;
上寻找