我的网站在wamp上没有任何问题,但是一旦我在bluehost帐户中托管它,我在提交表单和任何ajax调用上都会收到错误500.
错误的例子是
malformed header from script. Bad header=user_auth.php: fetch_cities.php
登录脚本的user_auth.php无需在此处发布。
我使用的是PHP 5.6我确实谷歌和我发现的一些解决方案是在php.ini内检查,没有显示magic_quotes_cpg=on
或register_globals = on
的行。关于可能是什么问题的任何指示都表示赞赏
fetch_cities.php
<?php
include('../../bin/initaccess.php');
$city = mysqli_real_escape_string($con, $_POST['city']);
$number = mysqli_real_escape_string($con, $_POST['number']);
if($number == 0){
echo "<option value=''>-- Select City --</option>";
$sql = "SELECT city_name FROM cities";
}else{
$sql = "SELECT city_name FROM cities WHERE city_name = '$city'";
}
$result = $db->query($sql);
while($row1 = mysqli_fetch_array($result)){
$city_name = $row1['city_name'];
?>
<option <?php if($city_name == $city){ echo "selected"; } ?> value='<?php echo $city_name; ?>'><?php echo $city_name; ?></option>
<?php
}
?>