我在这里遇到了一个奇怪的情况。此错误仅出现在目录中的一个文件上,并且在提交表单时也会出现。它在我的机器上运行良好。但是服务器顽固地在表单提交时抛出错误!
错误:
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>
<!--
<span id="somef">Some Fields</span>
<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');}
}
}
//-- ----------------------------------------------------------
?>