2013-06-12 6 views
0

여기에 이상한 상황이 있습니다. 이 오류는 디렉토리의 한 파일에만 나타나며 양식이 제출 될 때도 나타납니다. 그것은 내 컴퓨터에서 완벽하게 작동합니다. 그러나 서버가 양식 제출시 오류를 완강하게 던졌습니다!이상한 403 금지 된 오류

오류 :

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');} 
} 
} 
//-- ---------------------------------------------------------- 
?> 
+1

저는 PHP에 대한 전문가는 아니지만, PHP 자체와는 많이 관련이 없지만 서버의 PHP 사용자는 가지고 있거나 갖고 있지 않은 사용 권한이 있다고 생각합니다. – boztalay

+0

파일 /Myadmin/searchnsendmail2.php의 특정 사용 권한이 될 수도 있습니다 – miah

+0

이 코드는 상용 호스트 솔루션에서 호스팅됩니까? 파일 그룹에 쓰기 권한이있는 경우 PHP에서 '찾을 수 없음'으로 간주되는 것처럼 일부 사용 업체/솔루션 (cPanel, direcAdmin 등)은 wierd 규칙을 사용합니다. – marekful

답변

2

해결! 서버가 제출되지 않은 html 문자로 Textarea 값의 텍스트를 좋아하는 것 같습니다! 나는 그들을 제거하고 지금 alls 잘! 모두에게 감사드립니다!

나는 또한이 기회를 이용하여 내가이 문제에 대해봤을 때마다 항상 이것이 권한 문제라고 말하는 사람들을 항상 찾아 냈습니다. 갑자기 하나의 파일과 하나의 양식에 사용 권한 문제가 발생한 이유를 이해할 수 없을 정도로 너무 초조했습니다. 이 예가이 문제에 좌절하는 모든 사람들 (그리고 권한 문제를 답변으로 제공하는 사람들)에게 내 것과 같은 오류 일 수 있다는 것을 알기를 바랍니다. 많은 사람들에게 많은 시간을 절약해야합니다!

1

동일한 오류가 발생했지만 양식 길이로 인해 발생했습니다. 나는 수백 개의 들판이있는 형태를 가졌습니다. 일부 필드를 제거하면 양식이 성공적으로 제출되었습니다.

양식 길이가 mod_security에 대한 규칙을 트리거했습니다. 내 앱이 공유 호스팅에 있었기 때문에 규칙을 우회하는 호스팅 제공 업체에 대한 간단한 요청으로 문제가 해결되었습니다.

0

이 오류는 간헐적으로 양식이 포함 된 PHP 페이지를 제출할 때 발생했습니다. 제 경우에는 문제가 서버의 전체/tmp 디렉토리였습니다. 다른 사람에게 도움이 될 수 있도록 여기에 게시하십시오.