i have a web page that contains one input his name code_client
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<form action="getLatLon.php" method="POST">
<fieldset>
code_client: <input id="code_client" name="code_client" type="text"> <br><br>
<br>
<input type="submit" value="Voir" name="Chercher">
</fieldset>
</form>
</body>
</html>
image of the page web :
when i enter the value i send it (POST) to a getLatLong.php file , and i display as a result the information of the client(the owner of the code_client)
getLatLon.php
<?php
$DB_Server = "localhost"; //MySQL Server
$DB_Username = "root"; //MySQL Username
$DB_Password = "123456"; //MySQL Password
$DB_DBName = "db_abc"; //MySQL Database Name
$DB_TBLName = "location"; //MySQL Table Name
$code_client=$_POST['code_client'];
$objConnect = @mysqli_connect($DB_Server, $DB_Username, $DB_Password);
$objDB = @mysqli_select_db($objConnect, $DB_DBName);
$strSQL = "SELECT * FROM `location` WHERE CodeClient='".$code_client."' ";
$objQuery = @mysqli_query($objConnect, $strSQL) or die("Couldn't execute query:<br>" . mysqli_error(). "<br>" . mysqli_errno());
$arrRows = array();
$arryItem = array();
while($arr = mysqli_fetch_array($objQuery)) {
$arryItem["Id"] = $arr["Id"];
$arryItem["Latitude"] = $arr["Latitude"];
$arryItem["Longitude"] = $arr["Longitude"];
$arryItem["CodeClient"] = $arr["CodeClient"];
$arrRows[] = $arryItem;
}
$DATA = $arrRows;
echo json_encode($arrRows);
?>
the image of the result
i try to send the result of the forme to another php file
testExportvr.php
<?php
include 'getLatLon.php';
echo json_encode($DATA);
?>
i try to send the result of the forme to another php file , but until now i can't do it , it display some result different than the correct one
Does anyone know what I'm doing wrong? I need the form to submit the data to the file and in the same time the result will display in another file



testExportvr.php? Anything less than another$_POSTrequest will prevent that variable from being defined.<form action="getLatLon.php" method="POST">to<form action="testExportvr.php" method="POST">or what exactly have you tried?testExportvr.php