Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^4: Can't Get CGI Results Page to Redirect

by socrtwo (Sexton)
on Aug 05, 2009 at 13:54 UTC ( [id://786118]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Can't Get CGI Results Page to Redirect
in thread Can't Get CGI Results Page to Redirect

OK, I was able to find an open source uploader and intercept the header before it printed. Here' where I put the code:
if ($action eq 'admin') { print $query->header; if ($login && $password) { &admin($query, $login, $password); } else { print &PagePassword($NAME_TITLE{'common_admin'}); } } elsif ($action eq 'upload') { ##### My code begins ##### use CGI qw(:cgi); use strict; `perl newimg2db.pl > newimgseekurl.txt`; sleep 1 while ( !(-e "newimgseekurl.txt") ); use File::Copy; copy("newimgseekurl.txt", "newimgseekurl2.txt") or die "File canno +t be copied."; my $file = "newimgseekurl.txt"; unlink($file); open FILE, "newimgseekurl2.txt" or die "Couldn't open file: $!"; my $newimgseekurl = <FILE>; close FILE; print redirect("$newimgseekurl"); ##### My Code Ends ##### if ($dir = &check_password('guest', $login, $password)) { print &Upload($query, $dir); } else { print &BadPassword($NAME_TITLE{'common_member'}); } } else { print $query->redirect($FORM_URL);

This did not prevent the file from uploading and did properly redirect. Thanks for the help, views and voting.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://786118]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-18 19:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found