doujiyan0971 2015-01-01 12:46
浏览 83

错误405:不支持方法

I'm making a tor website that people can report sites to us (CP etc) and we will remove them. We are using an html form that submits via POST to php and then it E-Mails us the information. The problem I'm getting is:

Error 405: Method Not Supported
Only GET and HEAD requests supported for this resource.

Here is the code i am using: HTML:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Report site - Tor's anti-terrorism campaign.</title>
<style>
h1
{
    font-family:Verdana, Geneva, sans-serif;
    font-size:36px;
    color:#060;
}
h2
{
    font-family:Verdana, Geneva, sans-serif;
    font-size:16px;
    color:#C33;
}
</style>
</head>
<body>
<h1>Report a site on Tor for us to hopefully take down</h1>
<h2>Sites that are listed as inappropriate material for us are:</h2>
<h2>Child pornography</h2>
<h2>Terrorist sites</h2>
<h2>Piracy sites <i>that contain child pornography or terrorist material</i></h2>
<hr />
<h2 style="color:#030"><B>Things that are actually OK:</B></h2>
<h2 style="color:#030">Black markets</h2>
<h2 style="color:#030">Copyrighted material</h2>
<h2 style="color:#030">Piracy sites</h2>
<br />
<p>Any other site you would like to report please enquire about at CONTACT INFO.</p>
<hr />
<form method="post" action="form_handler.php" name="Report">
    <p>
    <input type="hidden" name="derive_fields" value="email=EmailAddr,realname=FullName">
    <br />
    <br />
    Contact E-Mail Address:
    <input type="text" name="email" placeholder="thats@riseup.net" size="50">
    <br />
    <br />
    First Name(Put anonymous to not be named): 
    <input type="text" name="first_name" placeholder="John" size="50">
    <br />
    <br />
    .Onion address or web address: 
    <input type="text" name="onion" placeholder="e.g. dwonbdbwqdb3.onion" size="50">
    </p>
    <p>
      Name of organization (if known): <input type="text" name="org" placeholder="organization name" size="31.75">
    </p>
    <p>
      What is it?<select name="Type" multiple="multiple" size="5">
        <option value="Terrorism">Terrorism</option>
        <option value="CP">Child porn</option>
        <option value="Other">Other</option>
        </select>
      <input type="submit" value="Submit" class="rc-button rc-button-submit">
    </p>  
</form></body>
</html>

And the PHP:

<?php
if(isset($_POST['submit'])){
    $to = "thats@riseup.net";
    $from = $_POST['email'];
    $first_name = $_POST['first_name'];
    $subject = "Form submission";
    $onion = $_POST['onion'];
    $org = $_POST['org'];
    $type = $_POST['Type'];
    $message = $first_name . "Here is the stats for the form submitted about the site"  $onion . " " . $org . " " . $type;
    mail($to,$subject,$message);
    echo "Mail Sent. Thank you " . $first_name . ";
    }
?>

Any help would be good! Thanks The html was made half by me and half by my friend and I completely wrote all the PHP so it will be the PHP which is probably wrong :)

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 keil的map文件中Image component sizes各项意思
    • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
    • ¥15 划分vlan后,链路不通了?
    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 Centos / PETGEM
    • ¥15 划分vlan后不通了
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)