<?php
$x1=$_POST["x1"];
$x2=$_POST["x2"];
$x3=$_POST["x3"];
$x4=$_POST["x4"];
$x5=$_POST["x5"];
function insertData(){
$query_insert = "insert into english (`f1`,`f2`,`f3`,`f4`,`f5`)
values("$x1","$x2","$x3","$x4","$x5")";
$con->query($query_insert);
do some other ting;
}
?>
this is too cumbersome, ha
<?php
function insertData(){
global $_POST;
extract($_POST);
$query_insert = "insert into english (`f1`,`f2`,`f3`,`f4`,`f5`)
values("$x1","$x2","$x3","$x4","$x5")";
$con->query($query_insert);
do some other ting;
}
?>
extract ($_ POST); is not safe, eliminated.
<?php
function insertData(){
$query_insert = "insert into english (`f1`,`f2`,`f3`,`f4`,`f5`)
values("$_POST["x1"]","$_POST["x2"]","$_POST["x3"]","$_POST["x4"]","$_POST["x5"]")";
$con->query($query_insert);
do some other ting;
}
?>
this is also very ugly,. Excuse me, is there the best way?
be concise and beautiful