我已经完成了一个 php 项目并将其上传到服务器上。我已经在 windows 上开发了它,现在我正试图将它部署到远程 linux 服务器上。但我收到错误。 页面的某些部分没有显示我不知道为什么? 例如,我有一页申请如下。我只能看到顶部,其他部分我看不到。
<?php
require 'inc/header.php';
require 'inc/config.php';
require 'inc/functions.php';
$QUERY0 = "
SELECT *
FROM states
";
$result0 = send_query($QUERY0);
$i=0;
while($row = mysql_fetch_array($result0))
{
$states_names[$i]=$row['sname'];
$states_val[$i] =$row['id'];
$i++;
}
$QUERY1 = "
SELECT *
FROM courses
";
$result1 = send_query($QUERY1);
$i=0;
while($row = mysql_fetch_array($result1))
{
$courses_names[$i]=$row['cname'];
$courses_val[$i]=$row['id'];
$i++;
}
$QUERY2 = "
SELECT *
FROM jobprofile
";
$result2 = send_query($QUERY2);
$i=0;
while($row = mysql_fetch_array($result2))
{
$jobprofiles_names[$i]=$row['jobname'];
$jobprofile_val[$i]=$row['jobid'];
$i++;
}
$QUERY3 = "
SELECT *
FROM edu
";
$result3 = send_query($QUERY3);
$i=0;
while($row = mysql_fetch_array($result3))
{
$edu_names[$i]=$row['eduq'];
$edu_val[$i]=$row['id'];
// echo "***********" .$edu_names[$i];
$i++;
}
?>
<div class="left">
<div class="left_articles">
<h2><a href="#">Register</a></h2>
<p class="description">Please submit the folloing form</p>
<p>
<form action="check.php" method="post">
<table border="0">
<tbody>
<tr>
<td>First name</td>
<td><input type="text" name="fname" value="" /></td>
</tr>
<tr>
<td>Last name</td>
<td><input type="text" name="lname" value="" /></td>
</tr>
<tr>
<td>Address</td>
<td><input type="text" name="address" value="" /></td>
</tr>
<tr>
<td>age</td>
<td><input type="text" name="age" value="" /></td>
</tr>
<tr>
<td>State of origin</td>
<td>
<select name="origin">
<? $i=0;
foreach( $states_names as $state )
{
$val= $states_val[$i] ;
?>
<option value="<? echo $val; ?>"><? echo $state; ?> </option>
<?
$i++;
}
?>
</select>
</td>
</tr>
<tr>
<td>Mobile no</td>
<td><input type="text" name="mobile" value="" /></td>
</tr>
<tr>
<td>Sex</td>
<td><select name="sex">
<option value="1">Male</option>
<option value="0">Female</option>
</select></td>
</tr>
<tr>
<td>Marrital Status</td>
<td><select name="ms">
<option value="0">Single</option>
<option value="1">Married</option>
</select></td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" name="email" value="" /></td>
</tr>
<tr>
<td>Job Applying For</td>
<td><select name="jobtype">
<? $i=0;
foreach( $jobprofiles_names as $job )
{
$val= $jobprofile_val[$i] ;
?>
<option value="<? echo $val; ?>"><? echo $job; ?> </option>
<?
$i++;
}
?>
</select>
</td>
</tr>
<tr>
<td>Have u worked in this sector before</td>
<td><select name="exp">
<option value="0">no</option>
<option value="1">yes</option>
</select></td>
</tr>
<tr>
<td>Which department of this sector u have worked?</td>
<td> <input type="text" name="exptype" value="" />
</td>
</tr>
<tr>
<td>Years of experinece in this sector</td>
<td><input type="text" name="yrsexp" value="" /></td>
</tr>
<tr>
<td>Higest Educational qualification</td>
<td><select name="eduq">
<? $i=0;
foreach( $edu_names as $ed)
{
$val= $edu_val[$i];
?>
<option value="<? echo $val; ?>"><? echo $ed; ?> </option>
<?
$i++;
}
?>
</select>
</td>
</tr>
<tr>
<td>Course taken in above educational qualification</td>
<td><select name="crc">
<? $i=0;
foreach( $courses_names as $crc)
{
$val= $courses_val[$i];
?>
<option value="<? echo $val; ?>"><? echo $crc; ?> </option>
<?
$i++;
}
?>
</select>
</td>
</tr>
<tr>
<td>Grade obtained in the above educational qualification</td>
<td><select name="grade">
<option value="0">A</option>
<option value="1">B</option>
<option value="2">C</option>
<option value="3">D</option>
</select>
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Apply now" /></td>
</tr>
</tbody>
</table>
<input type="hidden" name="action" value="check" />
</form>
</p>
</div>
</div>
<? require 'inc/right.php' ?>
<? require 'inc/footer.php' ?>
我的文件描述如下。 header 包含 header righ.php 包含页面右侧
为什么我的页面显示不全?斜杠/位置有问题吗?? 在 windows 和 linux 上有什么不同吗?
最佳答案
文件系统中inc和inc/headers.php的文件和目录都是小写的吗? Unix 文件名区分大小写。将 includes 更改为 require 以查看它是否会导致错误。
关于php项目部署新问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1369688/