...

View Full Version : much help needed please



mr_blobby
01-25-2004, 01:56 PM
I have a form to email program which I like very much and have tested.
It sends to my email box, but the program does not send the entire message.
I want to see what the sender has placed in each text box, and can`t figure out how to do this.
I had this program emailed to me from a friend, he does not know anything about php forms, so could someone take a look at it for me please, maybe try it out on there server and sort out the problem for me please.

As I said the form does not send everything that the sender placed in each text box, this is what I would like to receive to be able to view what they wrote.
If someone can help me please I will email them the php script.

This is just one single php file and does not use database.


Many Many thanks in advance for your help.

Here is the code.

<?php

// Script Name: PHP Contact Mailer

// Set page variables.
$title = "Seeker";
$back = "";
$bg = '000000';
$text = 'ffffff';
$link = 'ffffff';
$vlink = 'ffffff';
$trans = 'spinoutin';
$btntag = 'text=000070 insetselection';
$txtbxtag = 'bgcolor=ffffff text=000070 cursor=ff autoactivate nohighlight';

// Remove < and > from the email message.
$msg = str_replace("<","",$msg);
$msg = str_replace(">","",$msg);

// Set email variables.
$your_email = 'anyone@yourdomain.com';
$your_name = 'George';
$your_link = 'http://www.yourdomain.com';
$confirm_sub = 'Your emailform has been received';

$confirm_msg = "<html>
<body>
Hi $name,
<p>
Thank you for your email form regarding the part you are seeking: $sub.
<br>
We will respond to this request just quickly as possible.
<p>
Thanks again,
<br>
$your_name
<p>
<a href=$your_link>$your_link</a>
</body>
</html>";

$contact_msg = "<html>
<body>
$msg
</body>
</html>";

// Begin the sendmail routine.
if ($send) {
if (!$name || !$email || substr_count($email, '@') < 1 ||
substr_count($email, '.') < 1 || !$sub || !$msg) {
print <<<EOF
<html>
<title>Error!</title>
<body background="$back" bgcolor="$bg" text=$text link=$link
vlink=$vlink transition=$trans fontsize=medium>
<center>
<br><br>
<font s=7 c=f0><b>
Error!</b></font>
<p>
Please go back and correct the errors listed below:
<p>
<table>
<tr><td>
<ul>
EOF;

if (!$name) {
print "<li>Your name is missing!<br>"; }
if (!$email || substr_count($email, '@') < 1 || substr_count($email, '.') < 1) {
print "<li>Your email is missing or invalid!<br>"; }
if (!$sub) {
print "<li>The email subject is missing!<br>"; }
if (!$msg) {
print "<li>The email message is missing!";
}
print <<<EOF
</ul>
</table>
<p>
<a href="javascript:history.back()//">Back</a>
<br><br><br><br>
</center>
</body>
</html>
EOF;
}
else {

// Email that gets sent to you.
mail($your_email, $sub, $contact_msg, "From: $name < $email >");

// Email that gets sent to them.
mail($email, $confirm_sub, $confirm_msg, "From: $your_email");

// Print the thank you page.
print <<<EOF
<html>
<head><title>Message Sent</title>
<script>
setTimeout('history.go(-2)', 7000);
</script>
</head>
<body background="$back" bgcolor="$bg" text=$text link=$link
vlink=$vlink transition=$trans fontsize=medium>
<center>
<br><br><br>
<font size=7><b>
Your Message Was Sent.</b></font>
<p>
Thank You $name,
<br>
You will receive a confirmation email momentarily.
</center>
</body>
</html>
EOF;
}
}
else {

// Print the contact form page.
print <<<EOF
<html>
<head><title>$title</title></head>
<body background="$back" bgcolor="$bg" text=$text link=$link
vlink=$vlink transition=$trans fontsize=medium>
<center>
<br><br>
<font size=7><b>
$title</b></font>
<br><br><br>
<form method=post>
<table>
<tr><td>
Name:
<td>
<input name=name $txtbxtag size=25 maxlength=20>

<tr><td>
Email:
<td>
<input name=email $txtbxtag size=25 maxlength=50>
<tr><td>
Telephone:
<td>
<input name=telephone $txtbxtag size=25 maxlength=20>
<tr><td>
Mobile:
<td>
<input name=mobile $txtbxtag size=25 maxlength=20>
<tr><td>
make:
<td>
<input name=make $txtbxtag size=25 maxlength=20>
<tr><td>
model:
<td>
<input name=model $txtbxtag size=25 maxlength=20>
<tr><td>
Capacity:
<td>
<input name=capacity $txtbxtag size=25 maxlength=20>
<tr><td>
Year:
<td>
<input name=year $txtbxtag size=25 maxlength=20>
<tr><td>

<tr><td>
Subject:
<td>
<select name=sub width=240 $btntag>
<option value=""> Choose One
<option value="Mechanical Parts">mechanical parts
<option value="Frame Work Parts">frame work parts
<option value="Body Work Parts">body work parts
<option value="OTHER">Other
</select>

<tr><td colspan=2>
Message: <font size=1><i>(500 characters max)</i></font>
<br>
<textarea name=msg rows=4 cols=33 maxlength=500
$txtbxtag></textarea>

<tr><td align=center colspan=2>
<input type=submit name=send $btntag value="Submit Form">
<input type=reset $btntag value="Reset Form">
</table>
</form>
<br><br><br>
<font size=2>
<a href=http://www.anyone.co.uk>[- BACK -]</a></font>
<br><br>
<font size=2>
:: Powered by <a href=http://www.anyone.co.uk/pages/>anyone</a> ::
</font>
<br><br>
</center>
</body>
</html>
EOF;
}

?>

Taylor_1978
01-25-2004, 02:01 PM
You have a variable named $msg - but you have not set what $msg is valued to - you need to do something like:

$msg = "Name: $msg
Email: $email
etc"



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum