Hi guys hope you can assist :>)
Basically, I have 2 files in question.
1)
<server>simeswiki/testing/
hozfilm/ho
zimages_ar
t.php
and
2)
/cgi-bin/file-upload.cgi
In file 1), there is an upload form which upon submission, sends data to file 2).
In file-upload.cgi, there is a perl variable defined for what directory to store the uploaded files.
That variable is defined in that cgi file as follows...
$SAVE_DIRECTORY = "/var/www/html/simeswiki/u
ploader";
So, as you can see, at the moment it is hardcoded..... which is what i want to change.
#######################
WHAT IM TRYING TO DO:
#######################
Id like a way to do the following:
For the following file eg. file 1) -----> simeswiki/testing/hozfilm/
hozimages_
art.php
to have some kind of an included php function file that:
A) grabs the current folder path for simeswiki/testing/hozfilm/
hozimages_
art.php
eg. /var/www/html/simeswiki/te
sting/hozf
ilm
then
B) updates the $SAVE_DIRECTORY variable in the cgi file eg. File 2) ---> /cgi-bin/file-upload.cgi
full path is /var/www/cgi-bin/file-uplo
ad.cgi
So, after the function fires, whatever is previously set for $SAVE_DIRECTORY, for example:
$SAVE_DIRECTORY = "/var/www/html/simeswiki/u
ploader";
would change to:
$SAVE_DIRECTORY = " /var/www/html/simeswiki/te
sting/hozf
ilm";
if the page being viewed was:
simeswiki/testing/hozfilm/
hozimages_
art.php
Another example:
If my php page was:
simeswiki/testing/test01.p
hp
then, if the included function file was included for simeswiki/testing/test01.p
hp,
then the /cgi-bin/file-upload.cgi file would be updated to reflect:
$SAVE_DIRECTORY = " /var/www/html/simeswiki/te
sting";
I hope this makes sense guys.
Any help on this would be really appreciated.
Start Free Trial