【问题标题】:Concatenating strings retrieved from form $_Post in php连接从表单 $_Post 在 php 中检索的字符串
【发布时间】:2012-01-16 06:47:04
【问题描述】:

我通过 HTML 表单使用以下代码发布字符串:

<html>
<body>
<form name="form" enctype="multipart/form-data" action="test.php" method="post">
         <input name="message" 
         type="text" value=""><br/><br/>
        <input type="submit" value="Upload"/><br/>
         </form>
         </body>
         </html>

test.php 的代码如下:

   <?php
   $string1 = '$_POST["message"]';
   $og_url = "http://thepropagator.com/facebook/testapp/issue.php?name=".$string1;
echo $og_url;
   ?>

我遇到的问题是发布的字符串“$string1”似乎没有显示在 URL“http://thepropagator.com/facebook/testapp/issue.php?name=”的末尾我试图将它连接起来。谁能解释一下我做错了什么?

【问题讨论】:

    标签: php string forms post concatenation


    【解决方案1】:

    我想你想要$string1 = $_POST['message'];,没有引号。虽然我希望你的代码能提供http://thepropagator.com/facebook/testapp/issue.php?name=$_POST["message"] url。

    【讨论】:

      猜你喜欢
      • 2011-12-14
      • 1970-01-01
      • 2023-03-31
      • 2020-01-31
      • 2019-08-17
      • 2016-08-13
      • 2021-11-11
      • 2017-07-11
      • 1970-01-01
      相关资源
      最近更新 更多