Bug #76099 [NEW]: HTML <select> tag request problem at PHP server side

From: Date: Thu, 15 Mar 2018 09:00:01 +0000
Subject: Bug #76099 [NEW]: HTML <select> tag request problem at PHP server side
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214367@lists.php.net to get a copy of this message
From:             hrushiemail at gmail dot com
Operating system: windows 7 64bit
PHP version:      7.2.3
Package:          Performance problem
Bug Type:         Bug
Bug description:HTML <select> tag request problem at PHP server side

Description:
------------
<?php 
include('common/header.php');

?>
        <!--
============================================================== -->
        <!-- Page Content -->
        <!--
============================================================== -->
        <div id="page-wrapper">
          <div class="container-fluid">
                <div class="row bg-title">
                    <div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
                        <h4 class="page-title">Dashboard 1</h4> </div>
                    <div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
                        <!--<button class="right-side-toggle
waves-effect waves-light btn-info btn-circle pull-right m-l-20"><i
class="ti-settings text-white"></i></button>-->
                        <ol class="breadcrumb">
                            <li><a href="javascript:void(0)">MMP
BIZ</a></li>
                            <li class="active">Dashboard</li>
                        </ol>
                    </div>
                    <!-- /.col-lg-12 -->
                </div>
                <!-- /.row -->
                <!--
============================================================== -->
                <!-- Different data widgets -->
                <!--
============================================================== -->
             
			 </div>
				
       <div class="container-fluid">
		
		<div class="row">
			<div class="col-lg-12 text-center">
				<h1 class="page-header">Pending Transactions Report</h1>
			</div>
		</div><!--/.row-->
		
		
		<div class="row">
		<div class="col-lg-12">
			<div class="col-md-12">
				<div class="panel panel-default">
					<div class="panel-heading">
						Pending Transactions Report										
					
						</div>
					<div class="panel-body">
					 <form method="post" action="export_pending_transactions.php">
						<input type="submit" class="btn btn-success"
name="pending_transactions_report" value="Export to Excel (.xls)">	
						</form>
						
					<div class="table-responsive">							
					<table class="table table-hover table-responsive">
						  <tr>						  
						  <td><b>Token id</b></td>
						  <td><b>Associate id</b></td>
						   <td><b>Sponsor id</b></td>
						  <td><b>Type of Payment</b></td>						 
						  <td><b>Amount</b></td>
						  <td><b>Status</b></td>
						  <td><b>Date</b></td>
						<td><b>Place Reason</b></td>
						<td><b>Submit</b></td>
						  </tr>
					<?php
					
                  
                    $query="Select * From payment_info where
status!='paid'";
                    $result = mysqli_query($con,$query);

					 while($row = mysqli_fetch_assoc($result)) 
						{
						  ?>
						  
						  <tr>
						  
						  <td>
						  <?php echo $row['p_token_id'];?>
						  </td>
						   <td>
						  <?php echo $row['associate_id'];?>
						  </td>
						  <td>
						  <?php echo $row['sponsor'];?>
						  </td>
						  <td>
						  <?php echo $row['type_of_payment']; ?>
						  </td>						  
						  <td>
						  <?php echo $row['balance_amount']; ?>
						  </td>
						  <td>
						  <?php echo $row['status']; ?>
						  </td>
						  <td>
						  <?php echo $row['date']; ?>
						  </td>	
						<form method="post" name="form1">						  
						 <td>					
						 
						 <select name="update_status<?php echo $row['p_token_id'];?>"
class="form-control" onChange="check_error(<?php echo
$row['p_token_id'];?>)">
						 <option value="paid">Paid</option>
						 <option value="unpaid">Un-Paid</option>
						 <option value="technical_error">Technical error</option>
						 </select>
						  </td>	
						  <td>
						    <input type="hidden" name="update_type_of_payment"
value="<?php echo $row['type_of_payment'];?>"/>
						    <input type="hidden" name="update_balance_amount"
value="<?php
echo $row['balance_amount'];?>"/>
						  <input type="hidden" name="update_associate_id" value="<?php
echo $row['associate_id'];?>"/>
						  <input type="hidden" name="update_sponsor" value="<?php echo
$row['sponsor'];?>"/>
						   <input type="hidden" name="update_token_id" value="<?php
echo
$row['p_token_id'];?>"/>
						   <input type="hidden" name="error"/>
						  <input type="submit" class="btn btn-danger"
name="change_status"
value="Submit">
						  </td>
						  </form>
						  </tr>
						<script language="javascript">
						
						
						
						
						function check_error(demo)
						{
							
							var
status=document.getElementsByName("update_status"+demo)[0].value;
							
							if(status=="technical_error")
							{
								var message=prompt("Enter Technical Error","");
								//alert(message);								
								document.getElementsByName("error")[0].value=message;	
								document.form1.submit();							
							}
												
						}
							
						
						</script>
						  
						<?php  
						} 
						 @mysqli_free_result($result);
						
					?>   
                      </table>
					 
                         </div>              
                        
                        
					<?php
					if(isset($_POST['change_status']))
					{
						$val1='update_status'.$_POST['update_token_id'];
						$update_status=mysqli_real_escape_string($con,$_POST[$val1]);//$_POST[$val1];
						//$update_status=$_POST['update_status'];
						//echo "<script
language='javascript'>alert('".$update_status."');</script>";
						$update_associate_id=mysqli_real_escape_string($con,$_POST['update_associate_id']);
						$update_sponsor_id=mysqli_real_escape_string($con,$_POST['update_sponsor']);							
						$update_type_of_payment=mysqli_real_escape_string($con,$_POST['update_type_of_payment']);
						$error=mysqli_real_escape_string($con,$_POST['error']);
						
						
						if($_POST['error']!='' && $_POST['error'] != '
')
						{
							$update_status=$error;
						}
						//echo "<script
language='javascript'>alert('".$update_status."');</script>";
						if($update_type_of_payment=="Direct Joining")
						{
							$paying_associate_id=$update_sponsor_id;
						}
						if($update_type_of_payment=="Pair Completed")
						{
							$paying_associate_id=$update_associate_id;
						}
						$update_token_id=mysqli_real_escape_string($con,$_POST['update_token_id']);
						$update_balance_amount=mysqli_real_escape_string($con,$_POST['update_balance_amount']);
						$query="update payment_info set status='$update_status' where
associate_id='$update_associate_id' and p_token_id='$update_token_id'";
						//echo "<script
language='javascript'>alert('s');</script>";
						$result=mysqli_query($con,$query) or
die(mysqli_error($con));//issue ite ahe 1 min tite isssue nahiye
						
						if(!$result)
						{
							echo mysqli_error($con);
						}
						if($update_status="paid")
						{
							date_default_timezone_set('UTC');
					        $current_date=date('Y-m-d',time());	
							$query2="insert into withdraw_payment
values('','$update_balance_amount','$current_date','$update_token_id','$paying_associate_id')";
							$result2=mysqli_query($con,$query2);
							if(!$result2)
						{
							echo mysqli_error($con);
						}
							
						}
						header("Refresh:0");
					}
					
					
					?>
				
				</div>
			</div>
		</div><!--/.row-->
		
		
		
		

	
				   
				   
				   
				   
			</div>	       
               </div>
              

Test script:
---------------
HTML <select> tag value not get at server side sometime it gets but when
i do long refresh then it gets.....it sucessfully done in php5.6 version
but not work properly with php 7.3 and php 7.2 version....

Expected result:
----------------
HTML <select> tag request get at sever side (per request should work
properly)

Actual result:
--------------
please provide us patch for that

-- 
Edit bug report at https://bugs.php.net/bug.php?id=76099&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=76099&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=76099&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=76099&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=76099&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=76099&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=76099&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=76099&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=76099&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=76099&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=76099&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=76099&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=76099&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=76099&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76099&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=76099&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=76099&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=76099&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76099&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=76099&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=76099&r=mysqlcfg



Thread (5 messages)

« previous php.bugs (#214367) next »