CGI: redirect some value to the previous URL

W

Wenjie

Hello,


I add an upload file feature to a BBS using perl. The
difficult thing is how I manage to integrate the upload
and message posting: the BBS is written using CGI.pm but
the posting code block is mainly HTML and javascripts
with perl variables, so my standalone upload.pl won't
work. Now I provided the URL of upload.pl for the user
to use the uploading function. But the user have to
copy and paste the uploaded file name and 'back' to
previous page. My question is: could I use some trick
to redirect the upload.pl result to the previous page
automatically?


Thanks and best regards,
Wenjie
 
M

Mina Naguib

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,


I add an upload file feature to a BBS using perl. The
difficult thing is how I manage to integrate the upload
and message posting: the BBS is written using CGI.pm but
the posting code block is mainly HTML and javascripts
with perl variables, so my standalone upload.pl won't
work. Now I provided the URL of upload.pl for the user
to use the uploading function. But the user have to
copy and paste the uploaded file name and 'back' to
previous page. My question is: could I use some trick
to redirect the upload.pl result to the previous page
automatically

It's the same technique that any normal CGI uses to re-direct really. It's irrelevant that
upload.pl is receiving file contents and saving it into a file vs. normally receiving key=value
pairs and parsing them in memory.

You can output an HTTP "Location:" re-direct tag, or output text/html containing meta-refresh or
javascript re-direct code.












-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/f0y1eS99pGMif6wRApJ6AJ4x1LaUSV5xD+sbDzPKwP4aeTt1PwCg/ptU
O/rq9IudFEfwIDvnPAVTwC4=
=R7FF
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top