E
elven_rangers
Guest
It's not a 'scope' problem (at least not in the regular programming sense of the word).
As I can deduce, your install script works in multiple steps which are processed by the same script.
Now, at each step you need to pass on the name of the file as the use set it.
On step 1 (first if branch), you take the filename from the input where the user gives it (I assume). On that branch you can work with the $filename which you take from the $_POST array.
To have it on the second branch (which takes care of step 2 or something like that) you need to either place the $filename in session (see php.net about how to work with sessions, how to initialize them and put variables in them which you can later retrieve) OR add it to the url so that you can have it $_GET OR make a hidden input somewhere in the HTML output you have under the 1st branch so you can send it again by POST.
As I can deduce, your install script works in multiple steps which are processed by the same script.
Now, at each step you need to pass on the name of the file as the use set it.
On step 1 (first if branch), you take the filename from the input where the user gives it (I assume). On that branch you can work with the $filename which you take from the $_POST array.
To have it on the second branch (which takes care of step 2 or something like that) you need to either place the $filename in session (see php.net about how to work with sessions, how to initialize them and put variables in them which you can later retrieve) OR add it to the url so that you can have it $_GET OR make a hidden input somewhere in the HTML output you have under the 1st branch so you can send it again by POST.