1

我在这里遇到了一个奇怪的情况。此错误仅出现在目录中的一个文件上,并且在提交表单时也会出现。它在我的机器上运行良好。但是服务器顽固地在表单提交时抛出错误!

错误:

Forbidden

You don't have permission to access /Myadmin/searchnsendmail2.php on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.24 (Unix) mod_ssl/2.2.24 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at www.landshoppe.com Port 80

代码在这里;

searchnsendmail2.php

<?php error_reporting(E_ALL);include('adminmaster.htm');?>
<div style="margin-left:250px;text-align:left">
<ul>
<li style="display:inline;padding:20px"> <a href="csvtodb.php"><font style="color:maroon">CSV Display/Upload</font></a></li>
    <li style="display:inline;padding:20px"> <a href="excel_reader/example.php"><font style="color:maroon">XLS Upload and Display</font></a></li>
    <li style="display:inline;padding:20px"> <a href="searchnsendmail2.php"><font style="color:maroon">Data Search/Mail</font></a></li>
</ul>
    <h2> Send Property Details by eMail to some one !</h2>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
<table width="900"><tr><td>Email Id :</td><td><input type="text" name="emailid" value="<?php if(isset($_POST['emailid'])){echo $_POST['emailid'];} ?>"></td></tr>
<tr><td>Address : </td>
<td><textarea name="address" cols="50" rows="5">Dear     ,<br><br>
Ref our telecon, please find below details of properties as discussed.</textarea><br>
<tr><td>Search word<br></td><td><input type="text" name="searchword" value="<?php if(isset($_POST['searchword'])){echo $_POST['searchword'];} ?>"></td>

<td>
Select Table<br><select name="ltable" id="ltable">
<option value="all" <?php if(isset($_POST['ltable']) && $_POST['ltable']=="all"){echo "selected";} ?>>All</option>
<?php 
include('conn.php');
mysql_select_db("landshop_dblist");
$query=mysql_query("SELECT dbname FROM dblist");
while($info=mysql_fetch_assoc($query))
{$dtable=$info['dbname'];?>
<option value="<?php echo $dtable;?>" <?php if(isset($_POST['ltable']) && $_POST['ltable']==$dtable){echo "selected";} ?>><?php echo $dtable;?></option><?php }?>
<option value="clientdata" <?php if(isset($_POST['ltable']) && $_POST['ltable']=="clientdata"){echo "selected";} ?>>clientdata</option>
</select>
</td><td>
<!-- &nbsp;&nbsp;&nbsp;&nbsp;
<span id="somef">Some Fields</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span id="allf">All Fields</span>-->
Show Fields<br>
<select name="show">
<option value="fall" <?php if(isset($_POST['show']) && $_POST['show']=="fall"){echo "selected";} ?>>All</option>
<option value="some" <?php if(isset($_POST['show']) && $_POST['show']=="some"){echo "selected";} ?>>Some</option>
</select>
</td>
<td>Show Contacts<br>
<select name="sconts" >
<option value="Yes" <?php if(isset($_POST['sconts']) && $_POST['sconts']=="Yes"){echo "selected";} ?>>Yes</option>
<option value="No" <?php if(isset($_POST['sconts']) && $_POST['sconts']=="No"){echo "selected";} ?>>No</option>
</select>
</td>

</tr>
<tr><td>Signature :</td><td> <textarea name="sign" cols="50" rows="5">Please do revert if you can process any of the below<br><br>
Thanks and Regards<br><br>Anit</textarea></td></tr>
<tr><td><input type="submit" name="mailsubmit" onclick="MakeLinkSafe()"></td></tr></table>
</form>
<?php include('searchresults.php');?>
</div>

searchresults.php 如下;

<?php
if(isset($_POST['mailsubmit']))
{

$searchword=$_POST['searchword'];
echo $searchword."<br><br>";
$searchword=str_replace(array(","," "),"|",$searchword);
$searchword=explode("|",$searchword);

$ar=array();
$pr=array();
$are=array();
$pri=array();
$prop=array();
$cust=array();

///SOME FIELDS ------------------------------------------
if($_POST['show']=="some"){

//all tables__________
if($_POST['ltable']=="all"){echo "Coming Soon !";exit;}

//tables other than clientdata____________
else{include('somefields.php');if(isset($_POST['dfsubmit'])){include('maildetails.php');}}
}

//ALL FIELDS ------------------------------------------------
elseif($_POST['show']=="fall"){

//all tables_______________
if($_POST['ltable']=="all"){include('alltables.php');echo $salltables;include('maildetails.php');}

//clientdata_______________
//elseif($_POST['ltable']=="clientdata"){include('clientdata.php');}

//Other tables
else{$salltables="";include('searchall.php');echo $salltables;include('maildetails.php');}
}
}
//-- ----------------------------------------------------------
?>
4

3 回答 3

3

解决了 !服务器似乎不喜欢 Textarea 值中的文本并提交了 html 字符!我删除了它们,现在一切都好!谢谢大家!

我还想借此机会强调一个事实,即每当我搜索这个问题时,我总是发现有人说这是一个权限问题。太令人沮丧了,因为我无法理解为什么突然只有一个文件和一个表单出现权限问题。我希望我的这个例子能让所有对这个问题感到沮丧的人(以及那些提供权限问题作为答案的人)知道它也可能是我的错误并调查它。应该为很多人节省很多时间!

于 2013-06-13T09:40:53.860 回答
1

遇到同样的错误,但它是由表单长度引起的。我有一个包含数百个字段的表单。删除一些字段后,表单提交成功。

表单长度触发了关于 mod_security 的规则。我的应用程序位于共享主机上,因此向主机提供商提出绕过规则的简单请求就解决了问题。

于 2013-11-21T22:21:06.097 回答
0

我只是在提交包含表单的 php 页面时间歇性地遇到此错误...在我的情况下,问题是服务器上的完整 /tmp 目录。在此处发布此内容以防对其他人有所帮助。

于 2015-01-28T23:38:07.853 回答