【问题标题】:PHP ERROR Output in URL Field [closed]URL字段中的PHP错误输出[关闭]
【发布时间】:2013-11-16 01:13:59
【问题描述】:

我在动作部分有一个带有变量的表单,里面有一个路径/文件名,但是 我在浏览器的 Url 字段 中总是出现 403 错误,而不是正确的路径。她是 sn-p。

<?php $Path = './index.php' ?>

<form action="<?php $Path ?>" method="post" id="form_login">

有什么想法可能是错的。 感谢您的宝贵时间。

【问题讨论】:

    标签: php variables path


    【解决方案1】:

    我见过 2 个错误。

    <?php 
    
    $Path = './index.php'; // forgot to end the statement. 
    
    ?>
    /* forgot to echo and end the statement here */
    <form action="<?php echo $Path; ?>" method="post" id="form_login">
    

    【讨论】:

    • 嗨,url 字段仍然包含 403 错误,而不是变量的路径。
    • @dA_uNknOwN 您在提交页面时得到它,对吗?如果是这样,则意味着您定义的路径说明不正确..
    • @dA_uNknOwN 文件权限怎么样,index.php 是否可写?这段代码是在同一个 index.php 文件中还是在另一个文件中?
    • 它在另一个目录中的另一个 index.php。
    • 文件有权限的xampp测试环境
    【解决方案2】:

    你需要回应它:

    <form action="<?php echo $Path ?>" method="post" id="form_login">
    

    【讨论】:

      猜你喜欢
      • 2020-02-23
      • 1970-01-01
      • 2014-06-29
      • 1970-01-01
      • 2014-10-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多