-1
 <?php ob_start();
  require_once("auth.php");
   include("config.php");
    $obj = new kamran();
   $connection = $obj->connection();
   include("connector.php");
    if(isset($_SESSION['resid'])){
    $resellerid=$_SESSION['resid']; 
   }

if(isset($_SESSION['userEmail'])){
$resellerEmail=$_SESSION['userEmail'];
}
if(isset($_GET['oid']))
{

}
$orderid=$_GET['oid'];
$pagename="order";
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Order Details</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/datepicker3.css" rel="stylesheet">
<link href="../css/styles.css" rel="stylesheet">

Here is My html which seems perfect to me.
</script> </script>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="../proposal/reseller/js/ddsmoothmenu.js">

/***********************************************
* Smooth Navigational Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>

<script type="text/javascript">

ddsmoothmenu.init({
mainmenuid: "smoothmenu1", //menu DIV id
orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
classname: 'ddsmoothmenu', //class added to menu's outer DIV
//customtheme: ["#1c5a80", "#18374a"],
contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})

ddsmoothmenu.init({
mainmenuid: "smoothmenu2", //Menu DIV id
orientation: 'v', //Horizontal or vertical menu: Set to "h" or "v"
classname: 'ddsmoothmenu-v', //class added to menu's outer DIV
//customtheme: ["#804000", "#482400"],
contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})
</script>
<link rel="stylesheet" type="text/css" href="../proposal/reseller/ddsmoothmenu.css"/>
<link rel="stylesheet" href="themes/ui-lightness/jquery.ui.all.css">
<script src="js/jquery-1.7.2.js"></script>
<script src="ui/jquery.ui.core.js"></script>
<script src="ui/jquery.ui.widget.js"></script>
<script src="ui/jquery.ui.datepicker.js"></script>
<link rel="stylesheet" href="demos.css">
<script>
$(function() {
    $( ".datepicker" ).datepicker({ dateFormat: 'yy-mm-dd' });
});
</script>


</head>
<body>
<nav class="navbar navbar-custom navbar-fixed-top" role="navigation">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#sidebar-collapse"><span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span></button>
            <a class="navbar-brand" href="#"><span>AirOMCC</span>.com</a>
                <ul class="nav navbar-top-links navbar-right">

                <?php
        $results = mysqli_query($connection,"select count(cmmstatus) as total1 from comission where comission_name = 'one time' and cmmstatus = 1");
        foreach($results as $result){
            echo '
                <li class="dropdown"><a class="dropdown-toggle count-info" data-toggle="dropdown" href="onetime_comission.php">
                    <em class="fa fa-bell"></em><span class="label label-info">'.$result['total1'].'</span>
                </a>

                </li>';
        }
                $results = mysqli_query($connection,"select count(rsalert) as total2 from comission where comission_name = 'residual commission' and rsalert = 1");
        foreach($results as $result){
            echo '
                <li class="dropdown"><a class="dropdown-toggle count-info" data-toggle="dropdown" href="residual_comission.php">
                    <em class="fa fa-bell"></em><span class="label label-info">'.$result['total2'].'</span>
                </a>

                </li>';
        }
                ?>
            </ul>
        </div>
    </div><!-- /.container-fluid -->
    </nav>
    <div id="sidebar-collapse" class="col-sm-3 col-lg-2 sidebar">
    <div class="profile-sidebar">
                    <div class="profile-usertitle">
            <div class="profile-usertitle-name">Welcome <?php echo $supercreator; ?></div>
            <div class="profile-usertitle-status"><span class="indicator label-success"></span>Online</div>
        </div>
        <div class="clear"></div>
    </div>
    <div class="divider"></div>
    <form role="search">
        <div class="form-group">
            <input type="text" class="form-control" placeholder="Search">
        </div>
    </form>
    <?php include("menu.php");?>
    </div><!--/.sidebar-->

        <div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">
    <div class="row">
        <ol class="breadcrumb">
            <li><a href="#">
                <em class="fa fa-home"></em>
            </a></li>
            <li class="active">Order Details</li>
        </ol>
    </div><!--/.row-->



    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">


            <div class="panel panel-default">
                                    <div class="panel-body">
    <div class="col-md-12">

<br />

<table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="orange-heading"><strong>Order Details</strong></td>
<td align="right">

</td>
</tr>
</table>
<form action="view-order-details.php?oid=<?php echo $orderid; ?>" method="post">
<br />
<br />
<?php 
$orderdetails=mysql_fetch_array(mysql_query("select * from orders where orderid='".$orderid."'"));
$orderstatus=mysql_fetch_array(mysql_query("select * from orderstatus where orderid='".$orderid."'"));
$productqry=mysql_query("select * from orderproductsdetails where orderid='".$orderid."'");
?>

<table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>

    <td width="700">
    <table width="700" border="0" style="border:solid 1px #CCC; border-top:0;" cellspacing="0" cellpadding="0">
<tr>
<td width="180" height="28" class="types">Order reference #:</td>
<td width="518" class="values"><?php echo $orderdetails['orderid']; ?></td>
</tr>
<tr>
<td width="180" height="28" class="types">Customer ID:</td>
<td width="518" class="values"><input type="text" name="cid" id="cid" onblur="updateorder(this,'<?php echo $orderid; ?>','CustomerID'); this.readOnly='readonly';" readonly="readonly" style="border:0;width:430px;" value="<?php echo $orderdetails['CustomerID']; ?>" /> <img src="images/loading.gif" alt="loading" id="cidload" class="hider" /> <a href="javascript:void(0);" onclick="document.getElementById('cid').readOnly=''; document.getElementById('cid').className='border-blue'; document.getElementById('cid').focus();" class="edit">Edit</a></td>
</tr>






<tr>
<td height="28" class="types">First Name:</td>

    <td class="values"><input type="text" name="fname" id="fname" onblur="updateorder(this,'<?php echo $orderid; ?>','FirstName'); this.readOnly='readonly';" readonly="readonly" style="border:0;width:430px;" value="<?php echo $orderdetails['FirstName']; ?>" /> <img src="images/loading.gif" alt="loading" id="fnameload" class="hider" /> <a href="javascript:void(0);" onclick="document.getElementById('fname').readOnly=''; document.getElementById('fname').className='border-blue'; document.getElementById('fname').focus();" class="edit">Edit</a></td>
</tr>
<tr>            
<td height="28" class="types">Last Name:</td>

    <td class="values"><input type="text" name="lname" id="lname" onblur="updateorder(this,'<?php echo $orderid; ?>','LastName'); this.readOnly='readonly';" readonly="readonly" style="border:0;width:430px;" value="<?php echo $orderdetails['LastName']; ?>" /><img src="images/loading.gif" alt="loading" id="lnameload" class="hider" /><a href="javascript:void(0);" onclick="document.getElementById('lname').readOnly=''; document.getElementById('lname').className='border-blue'; document.getElementById('lname').focus();" class="edit">Edit</a></td>
</tr>
<tr>
<td height="28" class="types">Company Name:</td>

<td class="values">
<input type="text" name="companyname" id="companyname" onblur="updateorder(this,'<?php echo $orderid; ?>','companyname'); this.readOnly='readonly';" readonly="readonly" style="border:0; width:430px;" value="<?php echo $orderdetails['companyname']; ?>" /><img src="images/loading.gif" alt="loading" id="companynameload" class="hider" />
<a href="javascript:void(0);" onclick="document.getElementById('companyname').readOnly=''; document.getElementById('companyname').className='border-blue'; document.getElementById('companyname').focus();" class="edit">Edit</a>


    </td>
</tr>


<tr>
<td height="28" class="types">Company Contact Name:</td>

<td class="values">
<input type="text" name="company_contact_name" id="company-contact-name" onblur="updateorder(this,'<?php echo $orderid; ?>','company_contact_name'); this.readOnly='readonly';" readonly="readonly" style="border:0; width:430px;" value="<?php echo $orderdetails['company_contact_name']; ?>" /><img src="images/loading.gif" alt="loading" id="company-contact-nameload" class="hider" />
<a href="javascript:void(0);" onclick="document.getElementById('company-contact-name').readOnly=''; document.getElementById('company-contact-name').className='border-blue'; document.getElementById('company-contact-name').focus();" class="edit">Edit</a>


</td>
</tr>



<tr>
<td height="28" class="types">Primary Address:</td>

<td class="values"><input type="text" name="paddress" id="paddress" onblur="updateorder(this,'<?php echo $orderid; ?>','Paddress'); this.readOnly='readonly';" readonly="readonly" style="border:0;width:430px;" value="<?php echo $orderdetails['Paddress']; ?>" /><img src="images/loading.gif" alt="loading" id="paddressload" class="hider" /><a href="javascript:void(0);" onclick="document.getElementById('paddress').readOnly=''; document.getElementById('paddress').className='border-blue'; document.getElementById('paddress').focus();" class="edit">Edit</a></td>         
</tr>
<tr>
<td height="28" class="types">Secondry Address:</td>

<td class="values">
<input type="text" name="saddress" id="saddress" onblur="updateorder(this,'<?php echo $orderid; ?>','Saddress'); this.readOnly='readonly';" readonly="readonly" style="border:0;width:430px;" value="<?php echo $orderdetails['Saddress']; ?>" /><img src="images/loading.gif" alt="loading" id="saddressload" class="hider" />
<a href="javascript:void(0);" onclick="document.getElementById('saddress').readOnly=''; document.getElementById('saddress').className='border-blue'; document.getElementById('saddress').focus();" class="edit">Edit</a></td>
</tr>
<tr>
<td height="28" class="types">City:</td>

<td class="values"><input type="text" name="City" id="City" onblur="updateorder(this,'<?php echo $orderid; ?>','City'); this.readOnly='readonly';" readonly="readonly" style="border:0;width:430px;" value="<?php echo $orderdetails['City']; ?>" /><img src="images/loading.gif" alt="loading" id="Cityload" class="hider" />
<a href="javascript:void(0);" onclick="document.getElementById('City').readOnly=''; document.getElementById('City').className='border-blue'; document.getElementById('City').focus();" class="edit">Edit</a></td>
</tr>
<tr>
<td height="28" class="types">State:</td>

<td class="values">
<input type="text" name="State" id="State" onblur="updateorder(this,'<?php echo $orderid; ?>','State'); this.readOnly='readonly';" readonly="readonly" style="border:0;width:430px;" value="<?php echo $orderdetails['State']; ?>" /><img src="images/loading.gif" alt="loading" id="Stateload" class="hider" />
<a href="javascript:void(0);" onclick="document.getElementById('State').readOnly=''; document.getElementById('State').className='border-blue'; document.getElementById('State').focus();" class="edit">Edit</a>
    </td>
</tr>
<tr>
<td height="28" class="types">Zipcode:</td>

<td class="values">
<input type="text" name="Zipcode" id="Zipcode" onblur="updateorder(this,'<?php echo $orderid; ?>','Zipcode'); this.readOnly='readonly';" readonly="readonly" style="border:0;width:430px;" value="<?php echo $orderdetails['Zipcode']; ?>" /><img src="images/loading.gif" alt="loading" id="Zipcodeload" class="hider" />
<a href="javascript:void(0);" onclick="document.getElementById('Zipcode').readOnly=''; document.getElementById('Zipcode').className='border-blue'; document.getElementById('Zipcode').focus();" class="edit">Edit</a>
    </td>
</tr>
<tr>
<td height="28" class="types">Email:</td>   

<td class="values">
<input type="text" name="Email" id="Email" onblur="updateorder(this,'<?php echo $orderid; ?>','Email'); this.readOnly='readonly';" readonly="readonly" style="border:0;width:430px;" value="<?php echo $orderdetails['Email']; ?>" /><img src="images/loading.gif" alt="loading" id="Emailload" class="hider" />
<a href="javascript:void(0);" onclick="document.getElementById('Email').readOnly=''; document.getElementById('Email').className='border-blue'; document.getElementById('Email').focus();" class="edit">Edit</a>
</td>
</tr>
<tr>
<td height="28" class="types">Phone:</td>

<td class="values">
<input type="text" name="Phone" id="Phone" onblur="updateorder(this,'<?php echo $orderid; ?>','Phone'); this.readOnly='readonly';" readonly="readonly" style="border:0;width:430px;" value="<?php echo $orderdetails['Phone']; ?>" /><img src="images/loading.gif" alt="loading" id="Phoneload" class="hider" />
<a href="javascript:void(0);" onclick="document.getElementById('Phone').readOnly=''; document.getElementById('Phone').className='border-blue'; document.getElementById('Phone').focus();" class="edit">Edit</a>


    </td>
</tr>

<tr>
<td height="28" class="types" style="color:#F00;">Sales Person Name:</td>

<td class="values">
<input type="text" name="spname" id="spname" onblur="updateorder(this,'<?php echo $orderid; ?>','SalesPerson'); this.readOnly='readonly';" readonly="readonly" style="border:0; color:#F00; width:430px;" value="<?php echo $orderdetails['SalesPerson']; ?>" /><img src="images/loading.gif" alt="loading" id="spnameload" class="hider" />
<a href="javascript:void(0);" onclick="document.getElementById('spname').readOnly=''; document.getElementById('spname').className='border-blue'; document.getElementById('spname').focus();" class="edit">Edit</a>


    </td>
</tr>





<tr>
<td height="28" class="types borderbot">Order Date:</td>
<td class="values borderbot"><?php echo $orderdetails['Order_Date']; ?></td>
</tr>
<tr>
<td class="values borderbot"></td>
<td class="values borderbot"><input  name="btnosave" class="btn btn-primary" type="submit" value="save changes"  style="float: right;" /></td>

</tr>

Here is my php code which is not working for no idea what can cause this.

if(isset($_post['btnosave'])){
  echo'<script>alert("kuch to dekhao")</script>';
$cid =  $_post['cid']; 
  $fname = $_post['fname'];
  $lname = $_post['lname'];
  $companyname = $_post['companyname'];
  $company_contact_name = $_post['company_contact_name'];
  $paddress = $_post['paddress'];
  $saddress = $_post['saddress'];
  $City = $_post['City'];
  $State = $_post['State'];
  $Zipcode = $_post['Zipcode'];
  $Email = $_post['Email'];
  $Phone = $_post['Phone'];
  $spnam = $_post['spname'];
  mysqli_query($connection,"update orders set CustomerID = '".$cid."', FirstName = '".$fname."', LastName = '".$lname."', companyname = '".$companyname."', companyname = '".$companyname."', company_contact_name = '".$company_contact_name."', Paddress = '".$paddress."', Saddress = '".$saddress."', City = '".$City."',State = '".$State."',Zipcode = '".$Zipcode."',Email = '".$Email."',Phone = '".$Phone."',SalesPerson = '".$spname."' where orderid='".$orderid."'") or die("<script>alert('error in update query)</script>");
}

  ?>

Since i am new to php i have client he wants some changes in his already made product at old ago therefore you might will see some code which is deprecated but for now i am using mysqli for further work which he wants. But still i am getting issue with isset which should be work or atleast give error it is giving no any output.

noel
  • 7
  • 4
  • why is `$_post` lowercase? Change it to `$_POST` – Scuzzy Nov 30 '17 at 12:22
  • 1
    Please narrow this down to to the smallest possible code sample. Nobody wants to look through an entire page worth of code to try and help. Also, please make it clearer what the specific problem is, what it is doing, and what you want it to do. Please check out [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) – samanime Nov 30 '17 at 12:22
  • Your code is vulnerable to [**SQL injection**](https://en.wikipedia.org/wiki/SQL_injection) attacks. You should use prepared statements with bound parameters, via either the [**mysqli**](https://secure.php.net/manual/en/mysqli.prepare.php) or [**PDO**](https://secure.php.net/manual/en/pdo.prepared-statements.php) drivers. [**This post**](https://stackoverflow.com/questions/60174/how-can-i-prevent-sql-injection-in-php) has some good examples. – Alex Howansky Nov 30 '17 at 15:32

2 Answers2

2

In your isset statement use the post method caps like

if(isset($_POST['someval']))

and all other places also in your code.

1

$_post is not the right format. you need to use right code $_POST. when you use post method then apply the POST method in PHP code to uppercase. Please check your code before the post your question.