How to get all values using PHP inside the function Parameter?

I have custom PHP script,

code:

<html>
<head>
<title> Upgrade Cost</title>

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>

</head>
<body>
<!-- Ajax data -->
<h2>KoluPadi Upgrade Form</h2>
<form action='ajax_data.php' method='POST' >

<table border="0" cellspacing="1" cellpadding="2">
	<tr>
		<th> First Name : </th>
		<td> <input type="text" name="first_name"/> </td>
	</tr>
	<tr>
		<th> Last Name : </th>
		<td> <input type="text" name="last_name"/> </td>	
	</tr>
	
	<tr>
		<th> Address : </th>
		<td> <input type="text" name="address"/> </td>	
	</tr>
	
	<tr>
		<th> City : </th>
		<td> <input type="text" name="city"/> </td>	
	</tr>
	
	<tr>
		<th> State/Province : </th>
		<td> <input type="text" name="state_province"/> </td>	
	</tr>
	
	<tr>
		<th> Zip/Postal Code : </th>
		<td> <input type="text" name="zip_postal_code"/> </td>	
	</tr>
	
	<tr>
	    <th> Country : </th>
		<td>    
		    <td> <input type="text" name="country"/> </td>
	
		</td>
	</tr>
	
	<tr>
		<th> Email Id : </th> 
		<td> <input type="text" name="email_id"/></td>
	</tr>
	
	<tr>
		<th> Mobile Number : </th> 
		<td><input type="text" name="mobile_number"/></td>
	</tr>
	
	<tr>
		<th>I have : </th>
		<td>
			<select id="old" name="i_have">
				<option value = "select_option">Select Option</option>
				<option value = "three_compact">3 Compact</option>
				<option value = "three_regular">3 Regular</option>
				<option value = "three_triple">3 Triple</option>
				<option value = "five_compact">5 Compact</option>
				<option value = "five_regular">5 Regular</option>
				<option value = "five_triple">5 Triple</option>
				<option value = "seven_compact">7 Compact</option>
				<option value = "seven_regular">7 Regular</option>
				<option value = "seven_triple">7 Triple</option>
				<option value = "nine_compact">9 Compact</option>
				<option value = "nine_regular">9 Regular</option>
				<option value = "nine_triple">9 Triple</option>
			</select>
		</td>
	</tr>

	<tr>
		<th>I want : </th>
		<td>
			<select id="new" name="i_want">
				<option value = "select_option">Select Option</option>
				<option value = "three_compact">3 Compact</option>
				<option value = "three_regular">3 Regular</option>
				<option value = "three_triple">3 Triple</option>
				<option value = "five_compact">5 Compact</option>
				<option value = "five_regular">5 Regular</option>
				<option value = "five_triple">5 Triple</option>
				<option value = "seven_compact">7 Compact</option>
				<option value = "seven_regular">7 Regular</option>
				<option value = "seven_triple">7 Triple</option>
				<option value = "nine_compact">9 Compact</option>
				<option value = "nine_regular">9 Regular</option>
				<option value = "nine_triple">9 Triple</option>
			</select>
		</td>
	</tr>

	<tr>
		<th>Price (Rs) : </th>
		<td id="result"></td> 
			<input type="hidden" name="price" id="price"/>
		</tr>
		
	<tr>
		<th>Shipping Weight : </th> 
		<td id="show"></td>
		<input type="hidden" name="shipping_weight" id="shipping_weight"/>
	</tr> 
	<tr>
		<th>Shipping Cost (Rs) : </th> 
		<td id="findata"></td>
		 <input type="hidden" name="shipping_cost" id="shipping_cost"/>
		</tr> 
 	<tr>
		<th> Grand Total: </th> 
		<td> <input type="text" name="grand_total"/></td>
	</tr>		
		
</table> <br/> 

	<!-- <b><div id="result" name="price"></div></b> -->

	<input type="Submit" value="Pay" name="pay"/>

</form>
</body>


</html>

function :

       function getShippingEstimate($productId,$productQty,$countryId,$postcode)
                    {
                                   //my logic
                    }
      $result =  getShippingEstimate('14419','1',"IN","642001");

NOTE : I need only $countryId,$postcode

How can i get my $productId,$productQty,$countryId,$postcode from input form. Now i am given above as predefined value, how can i get all variables from input form?

in this code there’s no form.

@chorn Pls check with my updated post

manual: https://www.php.net/manual/en/reserved.variables.post.php

Sponsor our Newsletter | Privacy Policy | Terms of Service