PDA

View Full Version : Odd script issue


Swizylstik
01-22-2007, 09:34 PM
Hi,

I have a formmail script that is acting a little bit kooky. I have a redirect set, but instead of redicting to that URL, the script is writing that redirect in the browser window instead.

So instead of being directed to http://www.danielpbutler.com/error.html when the form is filled out incorrectly, I get a black browser window that says this:
1.29 Location: http://www.danielpbutler.com/error.html
And the address in the browser is that of the location of the script: http://www.simplymad.com/cgi-sys/FormMail.pl

Can anybody help?

-Tracy

KevinADC
01-22-2007, 09:51 PM
the scrit has printed an http header before printing the redirect stuff.

Swizylstik
01-22-2007, 10:13 PM
Okay, so is this wrong?

# If redirect option is used, print the redirectional location header. #
if ($Config{'redirect'}) {
print "Location: $safeConfig{'redirect'}\n\n";
}

KevinADC
01-22-2007, 10:37 PM
that part looks correct.

david_kw
01-22-2007, 10:42 PM
I believe he is saying you must have already done something like

print "Content-type: text/html\n\n";

somewhere in your code before the code you posted.

david_kw

KevinADC
01-23-2007, 12:10 AM
I believe he is saying you must have already done something like

print "Content-type: text/html\n\n";

somewhere in your code before the code you posted.

david_kw

yea, that or

print header

or

print $q->header()

or something similar if the script is using the CGI module.

Swizylstik
01-23-2007, 02:25 AM
That sorted the mess out. Thank you so much!:thumbsup: