My code contains files:
first_file.php
Var add_to_request will always contains one argument.
I would like to transfer variable add_to_request to session new_argument...
function properties(){
switch (current_propertie){
case "red":
var add_to_request="color = red";
document.getElementById("demo").innerHTML = add_to_request;
break;
case "small":
var add_to_request "size= small";
document.getElementById("demo").innerHTML = add_to_request;
break;
case "triangle":
var add_to_request="shape = triangle";
document.getElementById("demo").innerHTML = add_to_request;
break;
}
}
Another php file second_file.php contains
And I would like to write to the second file as new sql argument
connect_error) {
die("Connection failed: " . $conn->connect_error);
}
include 'first_file.php';
$sql = "SELECT thing FROM thing_table WHERE " .$_POST['new_argument'];
echo $sql;
What I have tried:
But when I run it. I see:
Notice: Undefined index: update_dotaz in C:\xampp\htdocs\things\second_file.php on line 9
SELECT thing FROM thing_table WHERE
Could you help me, how to write content of add_to_request to request in another file?
Thank you very much.