本文介绍了上传网站无法正常工作,但可以在localhost中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了一个网站并在localhost上测试它正常工作并显示数据,但是当我上传相同的文件时,它没有显示正确的输出或数据。
I have created a website and tested on localhost it works properly and show data but when i upload same file it doesnot shown correct output or data.
<?php include("../include/constr.php")?>
<?php include("../include/function.php")?>
<?php
$txtdaydes="";
$pid=0;
$action="";
$cnt=0;
$txtdes="";
$showerror="";
if(isset($_REQUEST['ACTION']))
{
//print_r($_REQUEST);
$action=$_REQUEST['ACTION'];
if($action=='UPDATE')
{
//echo operate($pid,$i);
$cnt=$_REQUEST['cnt'];
$pid=$_REQUEST['pid'];
echo $pid."<br>";
echo $cnt;
for($i=1;$i<=$cnt;$i++)
{
$txtdaydes =$_POST["txtdaydes".$i];
//echo "entered......";
$rs=mysqli_query($con,"select * from tbl_day where id=".$pid." and day_no=".$i." and status='YES'");
if(!$rs)
{
die("error".mysqli_error($con));
}
if(mysqli_fetch_array($rs))
{
//print_r($_REQUEST);
echo "Hello".$pid;
$rs=mysqli_query($con,"update tbl_day set description='".$txtdaydes."' where id=".$pid." and day_no=".$i."");
if(!$rs)
{
die("error in update".mysqli_error($con));
}
else
$showerror="Record Successfully Updated!<br/>";
}
else
{
// print_r($_REQUEST);
$rs=mysqli_query($con,"insert into tbl_day(id,day_no,description)values(".$pid.",".$i.",'".$txtdaydes."')");
if(!$rs)
{
die("error in insertion".mysqli_error($con));
}
else
$showerror="Record Successfully Inserted<br/>";
}
}//end for
} // end update action
if($action=='Load')
{
$pid=$_REQUEST['selectpackage'];
}
$rs=mysqli_query($con,"select pack_name from tbl_package where id=".$pid."");
if(!$rs)
{
die("error".mysqli_error($con));
}
$row=mysqli_fetch_array($rs);
$pname=$row['pack_name'];
//echo $pname;
}
?>
<form method="post" name="formdaydescription" id="formdaydescription" onSubmit="xmlhttpPost('./master/daydescription.php','formdaydescription','subdiv','Please Wait!');return false;">
<table class="tabledata" width="750px" border="1" height="auto" bgcolor="#CCCCCC" bordercolor="red" cellpadding="5" cellspacing="1">
<th class="stuinfo" colspan="9"> Day's Description For Package - <?php echo "<font color='#FFCCFF'>". $pname."</font>";?> <?php echo "<font color='red'>".$showerror."</font>"; ?> </th>
<tr bgcolor="#FfffFF" height="30px" align="">
<!--<td hight="30"><font color="#333333">Package Id</font></td>-->
<td width="74" hight="30"><font color="#333333">Sr. No.</font></td>
<td width="647" hight="30"><font color="#333333">Description</font></td>
</tr>
<?php
$count="select no_of_days from tbl_package where id=".$pid."";
$rs=mysqli_query($con,$count);
if(!$rs)
{
die("error".mysqli_error($con));
}
$row=mysqli_fetch_array($rs);
$cnt=$row['no_of_days'];
for($i=1;$i<=$cnt;$i++)
{
?>
<tr bgcolor="#F2FEFF" align="">
<!-- <td hight="60"><?php echo $pid;?></td>-->
<td hight="60"><?php echo $i?></td>
<td>
<input type="hidden" name="hidid[]" id="hidid" value="<?php echo $i ?>" />
<textarea name="txtdaydes<?php echo $i?>" cols="20" placeholder="Description" ><?php echo operate($pid,$i); ?></textarea>
</td>
</tr>
<?php
}// end for
?>
<tr bgcolor="#F2FEFF" align="">
<td hight="60" colspan="5" align="center">
<input type="submit" name="UPDATE" value="UPDATE"/>
<input type="hidden" name="ACTION" id="ACTION" value="UPDATE"/>
<input type="hidden" name="pid" value="<?php echo $pid;?>"/>
<input type="hidden" name="cnt" value="<?php echo $cnt;?>"/>
</td></tr>
</table>
</form>
推荐答案
这篇关于上传网站无法正常工作,但可以在localhost中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!