Click here to Skip to main content
15,904,935 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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.


XML
<?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>";?>&nbsp;<?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>
Posted
Updated 21-Apr-14 23:00pm
v2
Comments
kedar001 22-Apr-14 3:40am    
any Error ?
Member 9599723 22-Apr-14 4:43am    
no any error
Nelek 22-Apr-14 4:23am    
How are we supposed to help with such a poor information?

Don't think we can read minds or do astral projections to see your monitor. If you need help, the least you could do is to add some relevant code to your question or to explain your problem in such a way, that the users of CP can understand it. Otherwise, nobody will be able to help you.

Please use the "improve question" and add relevant information or a piece of code envolved. There are thousands of ways to screw things up, how are we supposed to know which one did you choose?

1 solution

This is too little information to detect the real problem.
Ensure that you can connect to the database successfully.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900