PDA

View Full Version : background colour?



woody
March 16th, 2001, 12:01
Hi I'm a newbie at this, so please excuse..
Could you tell me if there is any way of changing the background colour of the page the user is sent to after filling out a 'mail to' form (perl) see below.
In other words what text do I need to insert in the script itself ?!
Also how I can receive info from any other text fields in my form? (not just the message parameter).
Here follows the script I'm using at present..

# This script:
#
# - Takes the form contents
# - Saves the message into a temporary file
# - Calls Blat to send the mail
#


# Use the cgi unit
use cgi;

# Get the values from the form
$form = new CGI;
$sname=$form->param('sendername');
$saddr=$form->param('senderaddr');
$rname=$form->param('recipientname');
$raddr=$form->param('recipientaddr');
$subject=$form->param('subject');

$server="smtp.fasthosts.co.uk";
$message=$form->param('message');

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

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

# Save the message into a text file
open (messtxt,">message.txt");
print messtxt ($message);
close messtxt;

# Build the Blat command line and execute it
$blat="blat.exe message.txt -s \"$subject\" -t \"$lt$raddr$gt$rname\" -server $server -f \"$lt$saddr$gt$sname\"";

system($blat);


print "<br><br>Thanks for filling out this form, your message has been sent. Please click the link below to return.<br><br>";
print ("&copy; <a href=\"http://perso.wanadoo.es/woody/\">Island Bar</a>\n");

akersche
March 16th, 2001, 18:11
Originally posted by woody
Hi I'm a newbie at this, so please excuse..
Could you tell me if there is any way of changing the background colour of the page the user is sent to after filling out a 'mail to' form (perl) see below.
In other words what text do I need to insert in the script itself ?!
Also how I can receive info from any other text fields in my form? (not just the message parameter).
Here follows the script I'm using at present..

# This script:
#
# - Takes the form contents
# - Saves the message into a temporary file
# - Calls Blat to send the mail
#


# Use the cgi unit
use cgi;

# Get the values from the form
$form = new CGI;
$sname=$form->param('sendername');
$saddr=$form->param('senderaddr');
$rname=$form->param('recipientname');
$raddr=$form->param('recipientaddr');
$subject=$form->param('subject');

$server="smtp.fasthosts.co.uk";
$message=$form->param('message');

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

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

#SET THE BACKGROUD COLOR!!!!!
print "<body bgcolor=\"#FFF8DC\">" ;

# Save the message into a text file
open (messtxt,">message.txt");
print messtxt ($message);
close messtxt;

# Build the Blat command line and execute it
$blat="blat.exe message.txt -s \"$subject\" -t \"$lt$raddr$gt$rname\" -server $server -f \"$lt$saddr$gt$sname\"";

system($blat);


print "<br><br>Thanks for filling out this form, your message has been sent. Please click the link below to return.<br><br>";
print ("&copy; <a href=\"http://perso.wanadoo.es/woody/\">Island Bar</a>\n");

#END THE BODY TAG!!!
print "</body">" ;



SO what you wanna do is use the body tag!
and first start it and set the bgcolor and then close it.

Greetings Arno

woody
March 17th, 2001, 07:25
Thanks Arno,
That works great, the only problem left now is when I receive the info in my inbox from the form, all of the fields get printed out in one sentence (same line) how do I separate the fields?
Do I need to change something here?..

# Save the message into a text file
open (messtxt,">message.txt");
print messtxt ($message);
close messtxt;

Thanks again for your swift reply!

akersche
March 17th, 2001, 08:09
you are welcome.
you should learn coding html.
you need to insert <br> for a new line.

Greetings Arno

woody
March 17th, 2001, 19:56
Hi Arno
Thanks again, maybe you're right about the HTML coding (I'm so used to using Dreamweaver..lazy!)
Still unsure where to place the <br> tags. Can you help?
Promise I won't bug you again!
Here's the code with my 2 fields in the form ('message & 'refco')..

# Save the message into a text file
open (messtxt,">message.txt");
print messtxt ($message);
print messtxt ($refco);
close messtxt;

Cheers ;-)