Thread: Redirecting to URL
Results 1 to 2 of 2
08-20-2007, 05:01 AM #1
Redirecting to URL
I am desparately in need of some help here.
First of all CGI/Perl are greek to me. I am only familiar with PHP.
I have this Form with a File Field. Passing to a CGI file(upload.cgi?id=20) to process for File upload. I have to use CGI/Perl as it is uploading large file size.
The "id" variable in the URL is dynamic and will changes according to member who upload it.
I did not write the CGI file myself but found it from the internet which is Free for non-commercial usage.
Inside the "upload.cgi" file there is a variable set to redirect the file upon upload success.
$redirect = "http://www.baltech.com.my/index.php";
Somewhere further below the file there is a script to trigger the redirection :
# redirect user
print qq~Location: $redirect\n\n~;
My question is, how can I set the $redirect url to redirect to for instant...
The "id" variable should be the one passed to the cgi file.
Hope to find a solution here.
10-14-2007, 11:48 PM #2
Re: Redirecting to URL
I have probably understood you wrong, why don't you just change $redirect to
if you want to just change the id then you could have this:
$path = "http://www.baltech.com.my/index.php";
$id = "?id=20";
$redirect = "$path$id";
and you can change the id accordingly if needed. Etc etc