dskm94301 2015-05-13 06:19
浏览 26

试图在表单提交上调用外部php文件,获取404错误

I have a form which is being echoed by php:

echo '<form action="stsupport.php" method="POST">
<p>
Priority Name: <input type="text" size="50" name="ticketpriority" placeholder="Input a name for your priority..."></textarea>
</p>

<input type="submit" name="submitpriority" value="submit">

</form>';

I want the stsupport php file to run when the form is submitted but I am getting 404 error when the form is submitted.

The stsupport.php file is in the same folder as the file with the form.

Any ideas?

Edit:

This is in the support.php file where i call the function to create priority. The create priority function just displays the form above.

require_once(ABSPATH . 'wp-content\plugins\stsupport\adminmenu.php');

create_priority();

When the form is submitted i want to run:

function st_support(){
    require_once(ABSPATH . 'wp-content\plugins\stsupport\adminmenu.php');

    create_priority();

    if (isset($data['submitpriority'])) {
        insert_priority();
    }
}

The insert_priority function is inside the adminmenu.php file

  • 写回答

2条回答 默认 最新

  • douzai6337 2015-05-13 06:30
    关注

    Try open stsupport.php via browser

    Check your htaccess rule, if exist

    Check file permission

    Or

    if(file_exists('stsupport.php')){
        $action = 'stsupport.php';
    }else{
        $action = '';
    }
    echo '<form action="'. $action .'" method="POST">
    <p>
    Priority Name: <input type="text" size="50" name="ticketpriority" placeholder="Input a name for your priority..."></textarea>
    </p>
    
    <input type="submit" name="submitpriority" value="submit">
    
    </form>';
    
    评论

报告相同问题?

悬赏问题

  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思