Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 显示发布的html时出错_Php_Html_Parsing_Post - Fatal编程技术网

Php 显示发布的html时出错

Php 显示发布的html时出错,php,html,parsing,post,Php,Html,Parsing,Post,我将一个div的内容存储在一个textaera中,然后将内容发布到另一个页面 第二个页面应该简单地打印出html,就好像它是直接在该页面中编写的一样 除了html中有“的地方外,内容显示为\”(例如在图像源和ID上) 为什么会发生这种情况?我能做些什么来避免它 html: <textarea name="message" rows="10" cols="34"><table><tr> <td style="color: #333333;tab

我将一个div的内容存储在一个textaera中,然后将内容发布到另一个页面

第二个页面应该简单地打印出html,就好像它是直接在该页面中编写的一样

除了html中有“的地方外,内容显示为\”(例如在图像源和ID上)

为什么会发生这种情况?我能做些什么来避免它

html:

<textarea name="message" rows="10" cols="34"><table><tr>
      <td style="color: #333333;table-layout:fixed;text-align:left;vertical-align:top;" id="imgCell3"><img src="https://www.pnrbuilder.com/_images/itinerary/airlines_AC.gif"><br>
        AC # 7469</td>
      <td class="itinCell">06:30 AM on Tue, October 22, 2013<br>
        Newark/Elizabeth, NJ (EWR): Newark Liberty Intl. Airport</td>
      <td class="itinCell">8:03 AM on Tue, October 22, 2013 <br>
        Mississauga,&nbsp;Ontario,&nbsp;Canada (YYZ): Toronto Pearson Intl. Airport</td>
      <br>
    </tr>
  </table></textarea><br /><br />
<input type="submit" value="POST"/>
echo '<strong>This is the email content as it was posted to the page:</strong><br>'.$_POST['message'].'<br><br><br>';
<strong>This is the email content as it was posted to the page:</strong><br><table><tr>
      <td style=\"color: #333333;table-layout:fixed;text-align:left;vertical-align:top;\" id=\"imgCell3\"><img src=\"https://www.pnrbuilder.com/_images/itinerary/airlines_AC.gif\"><br>
        AC # 7469</td>
      <td class=\"itinCell\">06:30 AM on Tue, October 22, 2013<br>
        Newark/Elizabeth, NJ (EWR): Newark Liberty Intl. Airport</td>
      <td class=\"itinCell\">8:03 AM on Tue, October 22, 2013 <br>
        Mississauga, Ontario, Canada (YYZ): Toronto Pearson Intl. Airport</td>
      <br>
    </tr>
  </table>


AC#7469 2013年10月22日星期二上午6:30
纽瓦克/伊丽莎白,新泽西州(EWR):纽瓦克自由国际机场 2013年10月22日星期二上午8:03 加拿大安大略省米西索加(YYZ):多伦多皮尔森国际机场


php:

<textarea name="message" rows="10" cols="34"><table><tr>
      <td style="color: #333333;table-layout:fixed;text-align:left;vertical-align:top;" id="imgCell3"><img src="https://www.pnrbuilder.com/_images/itinerary/airlines_AC.gif"><br>
        AC # 7469</td>
      <td class="itinCell">06:30 AM on Tue, October 22, 2013<br>
        Newark/Elizabeth, NJ (EWR): Newark Liberty Intl. Airport</td>
      <td class="itinCell">8:03 AM on Tue, October 22, 2013 <br>
        Mississauga,&nbsp;Ontario,&nbsp;Canada (YYZ): Toronto Pearson Intl. Airport</td>
      <br>
    </tr>
  </table></textarea><br /><br />
<input type="submit" value="POST"/>
echo '<strong>This is the email content as it was posted to the page:</strong><br>'.$_POST['message'].'<br><br><br>';
<strong>This is the email content as it was posted to the page:</strong><br><table><tr>
      <td style=\"color: #333333;table-layout:fixed;text-align:left;vertical-align:top;\" id=\"imgCell3\"><img src=\"https://www.pnrbuilder.com/_images/itinerary/airlines_AC.gif\"><br>
        AC # 7469</td>
      <td class=\"itinCell\">06:30 AM on Tue, October 22, 2013<br>
        Newark/Elizabeth, NJ (EWR): Newark Liberty Intl. Airport</td>
      <td class=\"itinCell\">8:03 AM on Tue, October 22, 2013 <br>
        Mississauga, Ontario, Canada (YYZ): Toronto Pearson Intl. Airport</td>
      <br>
    </tr>
  </table>
echo'这是发布到页面的电子邮件内容:
'.$\u POST['message'.

';
结果源代码由php响应:

<textarea name="message" rows="10" cols="34"><table><tr>
      <td style="color: #333333;table-layout:fixed;text-align:left;vertical-align:top;" id="imgCell3"><img src="https://www.pnrbuilder.com/_images/itinerary/airlines_AC.gif"><br>
        AC # 7469</td>
      <td class="itinCell">06:30 AM on Tue, October 22, 2013<br>
        Newark/Elizabeth, NJ (EWR): Newark Liberty Intl. Airport</td>
      <td class="itinCell">8:03 AM on Tue, October 22, 2013 <br>
        Mississauga,&nbsp;Ontario,&nbsp;Canada (YYZ): Toronto Pearson Intl. Airport</td>
      <br>
    </tr>
  </table></textarea><br /><br />
<input type="submit" value="POST"/>
echo '<strong>This is the email content as it was posted to the page:</strong><br>'.$_POST['message'].'<br><br><br>';
<strong>This is the email content as it was posted to the page:</strong><br><table><tr>
      <td style=\"color: #333333;table-layout:fixed;text-align:left;vertical-align:top;\" id=\"imgCell3\"><img src=\"https://www.pnrbuilder.com/_images/itinerary/airlines_AC.gif\"><br>
        AC # 7469</td>
      <td class=\"itinCell\">06:30 AM on Tue, October 22, 2013<br>
        Newark/Elizabeth, NJ (EWR): Newark Liberty Intl. Airport</td>
      <td class=\"itinCell\">8:03 AM on Tue, October 22, 2013 <br>
        Mississauga, Ontario, Canada (YYZ): Toronto Pearson Intl. Airport</td>
      <br>
    </tr>
  </table>
这是发布到页面的电子邮件内容:

AC#7469 2013年10月22日星期二上午6:30
纽瓦克/伊丽莎白,新泽西州(EWR):纽瓦克自由国际机场 2013年10月22日星期二上午8:03 加拿大安大略省米西索加(YYZ):多伦多皮尔森国际机场

尝试使用php中的stripslashes()来取消引号。参考

Lifesaver,我在谷歌上搜索了几个小时,但并不知道我在找什么!