0

I need to store some variable which I can extract from javascript and later need to use on php when submit the form.

So I have created input field on html like

HTML
<input type="hidden" name="videoname_var" id="videoname_var" method="get"/>
And on init I have set the value of this input from java script

JS
document.getElementById("videoname_var").value = VIDEO_NAME_;
And later on submit, from php I am accessing the value like,

$videoname = $_GET['videoname_var'];

But the value of $videoname is always null,

Anything wrong on this approach?.

Here is the from,

 


And I am setting the value from java script $(document).ready() like

document.getElementById("videoname_var").value = VIDEO_NAME_;
And at on submit button click

This php was executing

if (isset($_FILES['file']))<br /> {<br /> $videoname = $_GET['videoname_var'];<br /> }