Page 1 of 1

giving a defined variable an option

Posted: Thu Jan 15, 2004 12:15 pm
by glennn3
having this (an upload directory):

Code: Select all

define ("BASEFOLDER", $baseFolder."uploadFiles/");
and this:

Code: Select all

$target = BASEFOLDER . $RCFILESї'file2upl']ї'name']ї$i];

i would like to provide an option of uploading to one of a few folders...

could someone show me how a "select" form field could be written to change this variable...?

am i asking the right question?

:),
thanks, glennn

Posted: Thu Jan 15, 2004 2:06 pm
by kettle_drum
Make the form on the first page with the select box, and have the value as the directory name:

<select name="folder">
<option value="test">test
<option value="test2">test2
<option value="test3">test3
</select>

Then on the next page add the var to your base directory:

define ("BASEFOLDER", $baseFolder."uploadFiles/".$_POST[folder]."/");