I have a site that I Iam putting together www.debtreliefni.com, Iam trying to process the form using a form called ' Form to Mail Script, I normally use my own but Iam having problems with it on fasthosts server and cant change the permissions on the CGI-bin, Iam looking to know what I need to do in order to process this form.
What hidden fields on the form do I use and what do I edit on the script belowd in order to process it?
Ive also attached the source code for the form on the site.
Anyone any ideas most appreciated
#########################
# Form To Mail Script #
# --------------------- #
# Pete Jefferson/ #
# FastHosts #
# #
# Windows NT Friendly!! #
#########################
# 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');
# 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 \"$raddr\" -server $server -f \"$saddr\"";
system($blat);
print $blat;
print "<br><br>Done.<br><br>";
print "Mail sent to $raddr.";
FORM SOURCE ON ON THE SITE
<form id="RHS_Form" action="cgi-bin/form.pl" method="post" name="RHS_Form">
<table width="193" border="0" cellspacing="3" cellpadding="2">
<tr>
<td>Name</td>
<td><input type="text" name="name" size="19" /></td>
</tr>
<tr>
<td>Surname</td>
<td><input type="text" name="surname" size="19" /></td>
</tr>
<tr>
<td>Tel No.</td>
<td><input type="text" name="Tel No." size="19" /></td>
</tr>
<tr>
<td>No. of<br />
creditors</td>
<td><select name="Creditors" size="1">
<option value="one"></option>
<option value="two">1</option>
<option value="value">2</option>
<option value="value">3</option>
<option value="value">4</option>
<option value="value">5</option>
<option value="value">6</option>
<option value="value">7</option>
<option value="value">8</option>
<option value="value">9</option>
<option value="value">10</option>
<option value="value">10+</option>
</select></td>
</tr>
<tr>
<td>Debt Amount</td>
<td><input type="text" name="DebtAmount" size="19" /></td>
</tr>
<tr>
<td>Best Timeto Call</td>
<td><input type="text" name="best time to call" size="19" /></td>
</tr>
<tr>
<td></td>
<td><button name="Apply Now" type="submit">Apply</button><input type="reset" /></td>
</tr>
</table>
<input type="hidden" name="subject" value="Side Form" /><input type="hidden" name="redirect" value="http://www.debtreliefni.com/Pages/Thankyou.html" /><input type="hidden" name="recipent" value="info@debtreliefni.com" /><input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT" />
</form>
What hidden fields on the form do I use and what do I edit on the script belowd in order to process it?
Ive also attached the source code for the form on the site.
Anyone any ideas most appreciated
#########################
# Form To Mail Script #
# --------------------- #
# Pete Jefferson/ #
# FastHosts #
# #
# Windows NT Friendly!! #
#########################
# 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');
# 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 \"$raddr\" -server $server -f \"$saddr\"";
system($blat);
print $blat;
print "<br><br>Done.<br><br>";
print "Mail sent to $raddr.";
FORM SOURCE ON ON THE SITE
<form id="RHS_Form" action="cgi-bin/form.pl" method="post" name="RHS_Form">
<table width="193" border="0" cellspacing="3" cellpadding="2">
<tr>
<td>Name</td>
<td><input type="text" name="name" size="19" /></td>
</tr>
<tr>
<td>Surname</td>
<td><input type="text" name="surname" size="19" /></td>
</tr>
<tr>
<td>Tel No.</td>
<td><input type="text" name="Tel No." size="19" /></td>
</tr>
<tr>
<td>No. of<br />
creditors</td>
<td><select name="Creditors" size="1">
<option value="one"></option>
<option value="two">1</option>
<option value="value">2</option>
<option value="value">3</option>
<option value="value">4</option>
<option value="value">5</option>
<option value="value">6</option>
<option value="value">7</option>
<option value="value">8</option>
<option value="value">9</option>
<option value="value">10</option>
<option value="value">10+</option>
</select></td>
</tr>
<tr>
<td>Debt Amount</td>
<td><input type="text" name="DebtAmount" size="19" /></td>
</tr>
<tr>
<td>Best Timeto Call</td>
<td><input type="text" name="best time to call" size="19" /></td>
</tr>
<tr>
<td></td>
<td><button name="Apply Now" type="submit">Apply</button><input type="reset" /></td>
</tr>
</table>
<input type="hidden" name="subject" value="Side Form" /><input type="hidden" name="redirect" value="http://www.debtreliefni.com/Pages/Thankyou.html" /><input type="hidden" name="recipent" value="info@debtreliefni.com" /><input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT" />
</form>