How to pass a php variable containing js script to a function?

26 Views Asked by At

I have a php variable $ext used to take value of a js variable fp

$nam = $_POST['subject'];
$ext = "<script>document.writeln(fp);</script>";

I need to pass the variables into move_uploaded_file function like this

$x = 'uploads/' . $nam . "." . $ext; // a temp variable to join those variables

if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $x))

Is it possible ?

0

There are 0 best solutions below