Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect to url after blat

Status
Not open for further replies.

WayneC

IS-IT--Management
Jun 22, 2001
6
GB
Can someone tell me if and how I can add a script to redirect to a url as soon as the blat has executed.
I have listed the script below that I am using.

# Use the cgi unit
use cgi;

# Get the values from the form
$form = new CGI;



$subject="Mortgage Lead";
$tome="hypersonic.co\@virgin.net";
$fromme="Wayne";
$server="smtp.futurecash.net";



$server="smtp.futurecash.net";
$lastname=$form->param('lastname');
$firstname=$form->param('firstname');
$dateofbirth=$form->param('dateofbirth');
$address1=$form->param('address1');
$address2=$form->param('address2');
$city=$form->param('city');
$county=$form->param('county');
$postcode=$form->param('postcode');
$firsttime=$form->param('firsttime');
$homemover=$form->param('homemover');
$remortgage=$form->param('remortgage');
$review=$form->param('review');
$std=$form->param('std');
$number=$form->param('number');
$email=$form->param('email');


$lt='<';
$gt='>';

# Output the correct header
print &quot;Content-type: text/html\n\n&quot;;

# Save the message into a text file
open (messtxt,&quot;>message.txt&quot;);

print messtxt ($lastname, &quot;\n&quot;);

print messtxt ($firstname, &quot;\n&quot;);

print messtxt ($dateofbirth, &quot;\n&quot;);

print messtxt ($address1, &quot;\n&quot;);

print messtxt ($address2, &quot;\n&quot;);

print messtxt ($city, &quot;\n&quot;);

print messtxt ($county, &quot;\n&quot;);

print messtxt ($postcode, &quot;\n&quot;);

print messtxt ($firsttime, &quot;\n&quot;);

print messtxt ($homemover, &quot;\n&quot;);

print messtxt ($remortgage, &quot;\n&quot;);

print messtxt ($review, &quot;\n&quot;);

print messtxt ($std, &quot;\n&quot;);

print messtxt ($number, &quot;\n&quot;);

print messtxt ($email, &quot;\n&quot;);

close messtxt;

# Build the Blat command line and execute it

$blat=&quot;blat.exe message.txt -s \&quot;$subject\&quot; -t \&quot;$tome\&quot; -f \&quot;$fromme\&quot; -server $server\&quot; &quot;;

system($blat);

print $blat;
print &quot;<br><br>Thank You.<br><br>&quot;;
print &quot;Your enquiry has been sent. A Financial representative will contact you shortly. $raddr.&quot;;




Thanks

WayneC
 
You want to redirect instead of printing the thank you messages? Replace all the prints after the system($blat) call with:
Code:
print &quot;Location: [URL unfurl="true"]http://www.whereever.com\n\n&quot;;[/URL]
Also, remove the line near the middle where you print out the Content-type header, otherwise it won't work.
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top