您好我是使用Hostinger cpanel开发网站的初学者。目前,我遇到了一些问题,即#34;该页面目前无法处理此请求"并且也称为HTTP Error 500.我所做的一切都可以在localhost wordpress中工作,但它不能在hostinger wordpress中完成。问题是什么,有人可以告诉我解决方案是什么?
process.php(放入文件管理器(目录:u472535631> public_html> wp_content> themes> main> process.php))
<?php
error_reporting(E_ALL & ~E_NOTICE);
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
// connect to the server and select database
mysql_connect("u472535631_kanguh", "u472535631_kanguh", "123456789");
mysql_select_db("u472535631_kanguh");
// Get values passe from form in login.php file
$username = $_POST['user'];
$password = $_POST['pass'];
// to prevent mysql injection
$username = stripcslashes($username);
$password = stripcslashes($password);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
// Query the database for user
$result = mysql_query("select * from login where ID = '$username' and Password = '$password'")
or die("Failed to query database ".mysql_error());
$row = mysql_fetch_array($result);
session_start();
if($row['ID'] == $username && $row['Password'] == $password){
if(isset($_POST["captcha"])&&$_POST["captcha"]!=""&&$_SESSION["code"]==$_POST["captcha"]){
header( 'Location: http://wins134/login' ) ;
}
else{
die("Wrong Code Entered");
}
}
else{
echo "Failed to login!";
}
?>
Wordpress(登录页面)
<form id="form1" name="form1" method="post" action="../../wp-content/themes/main/process.php" onsubmit="return check();">
<div class="dibg">
<div class="border">
<div class="shuo">
<div class="shuo_img"><img class="alignnone size-full wp-image-11" src="../wp-content/uploads/2017/04/shuo.jpg" alt="" width="70" height="95" /></div>
<div class="shuo_txt"><h2><stong>Login Page</stong></h2></div>
</div>
<div class="main">
<table style="width:auto;height:auto;border:0;margin-left:-55px;">
<tr>
<td width="51" height="27">Username:</td>
<td colspan="2"><input name="user" type="text" class="textbox" id="user" maxlength="20"/></td>
</tr>
<tr>
<td height="27">Password:</td>
<td colspan="2"><input name="pass" type="password" class="textbox" id="pass" /></td>
</tr>
<tr>
<td height="33">Captcha:</td>
<td width="65"><input name="captcha" type="text" class="textbox1" id="captcha" size="6" maxlength="4" /></td>
<td width="79"><div style="padding:2 0 0 5px; cursor:pointer; width:50px;"><img src="../../wp-content/themes/main/captcha.php" name="yzm" width="50" height="20" id="yzm" title="Click"/></div></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" id="btn" name="submit" value="Submit" class="button"/></td>
<td><input type="reset" name="cz" id="btn" value="Reset" class="reset"/></td>
</tr>
</table>
</div>
</div>
</div>
</form>
captcha.php(放入文件管理器(目录:u472535631&gt; public_html&gt; wp_content&gt; themes&gt; main&gt; capthca.php))
<?php
session_start();
$code=rand(1000,9999);
$_SESSION["code"]=$code;
$im = imagecreatetruecolor(50, 24);
$bg = imagecolorallocate($im, 22, 86, 165); //background color blue
$fg = imagecolorallocate($im, 255, 255, 255);//text color white
imagefill($im, 0, 0, $bg);
imagestring($im, 5, 5, 5, $code, $fg);
header("Cache-Control: no-cache, must-revalidate");
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>
谢谢。