Form redirection

Now1

New member
Joined
Feb 13, 2009
Messages
5
Hi all

I posted a form on my website.
When sending the content I have a GOTOURL instruction redirecting the user to a thankyoupage.htm. here is the HTML code

<INPUT TYPE="hidden" NAME="GOTOURL" VALUE="http://www.now1.info/Fr/Programme/Amanae_FOB/Merci4.htm">

No matter where I save the redirection page I end up here

http://www.now1.info/cgi-bin/mailer

I just migrated to a new hosting company and i realize that the mailer.cgi script may not exist here !
is there any standard existing mailer.cgi script available for users here ,

If not, how can I redirect the user to the proper page and get the form's content in my email box?

Thank you !!!!


Rich
 
Last edited:
Here is the DirectAdmin forum. You need to check with your hosting company; only they decide which programs they install by default. DirectAdmin doesn't install anything into your cgi-bin by default.

Jeff
 
Here is the DirectAdmin forum. You need to check with your hosting company; only they decide which programs they install by default. DirectAdmin doesn't install anything into your cgi-bin by default.

Jeff
Thank you Jeff

Indeed the hosting company doesn't offer any mailer.cgi file

I saved one on the cgi-bin directory but I am struggling to get it do the job. Only messages that it doesn't work on the server.

the file is mailer.cgi is this the correct syntax?

Any mistake in there you think?

#!/usr/local/bin/python
from smtplib import SMTP
import sys
import sys
import cgi
import string

#enable the next 2 lines for debugging purposes
#import cgitb
#cgitb.enable()

print 'Content-type: text/html\n\n'
form = cgi.FieldStorage()
from_user=form.getvalue('FROM')[1]
to_user=form.getvalue('TO')
subject=form.getvalue('SUBJECT')

msg=""
for i in form.keys():
if i=='FROM' :
msg += str(i)+": " + form.getvalue(str(i))[1] +"\n"
else:
msg += str(i)+": " + form.getvalue(str(i)) +"\n"

#mail sending.requires an SMTP service on the server
mailserver="localhost"
s=SMTP(mailserver)
body = string.join((
"From: %s" % from_user,
"To: %s" % to_user,
"Subject: %s" % subject,
"",
msg ), "\r\n")
s.sendmail(from_user, [to_user], body)
s.quit()
s.close()

#enable next 2 lines if your form define a redirect URL,after CGI processing
redirect_url="<meta HTTP-EQUIV=\"REFRESH\" content=\"0;url="+form.getvalue('GOTOURL')+"\">"
print redirect_url

Thanksss

Richard
 
I don't get involved in figuring out why programs don't work; perhaps someone else will help you or will recommend a script.

Jeff
 
Back
Top