使用$ _POST

时间:2015-10-15 15:01:22

标签: php

尝试使用一系列图片发送电子邮件...现在它只发送一封带有“文件名”的电子邮件,但我想要提取图片。我做错了什么?

我尝试了两种方式:

$email_body .= "<img src="http://example.com/logos/".$_POST['game' . $result['gameID']] .".png" style="width: 30px;">&nbsp;\n";

和交替引号:

$email_body .= '<img src="http://example.com/logos/".$_POST['game' . $result['gameID']] .".png" style="width: 30px; padding: 3px;">&nbsp;&nbsp;\n';

看起来很简单,但我无法弄清楚。现在它发送“文件名”很好,用这个:

$email_body .= "".$_POST['game' . $result['gameID']] ."&nbsp;\n";

3 个答案:

答案 0 :(得分:0)

以下内容出现错误〜您没有关闭$_POST['game']并且末尾有一个方括号太多且引号中不匹配:

$email_body .= "<img src="http://example.com/logos/".$_POST['game' . $result['gameID']] .".png" style="width: 30px;">&nbsp;\n";

或许应该是:

$email_body .= "<img src='http://example.com/logos/" . $_POST["game{$result['gameID']}"] . ".png' style='width: 30px;'>&nbsp;\n";

答案 1 :(得分:0)

试试这个

$email_body ="";
$email_body .= "<img src='"."http://example.com/logos/".$_POST['game' . $result['gameID']] .".png' style='width: 30px;'>&nbsp";

你弄错了引号

答案 2 :(得分:0)

引用错误:正确答案是:

$email_body .= "<img src='http://example.com/logos/".$_POST['game' . $result['gameID']] .".png' style='width: 30px;'>&nbsp;\n";