|
-
Aug 7th, 2006, 07:21 AM
#1
Thread Starter
Frenzied Member
Resolved
Hello guys can anyone help me please.
I need this code posted below to send the required fields to my email address everytime i test it, it dosent send to my email address.
HTML Code:
<TABLE width="44%"
border=0 cellPadding=0 cellSpacing=5>
<TBODY>
<TR>
<TD class=links vAlign=top><SPAN
class=style33></SPAN>
<form action="" method="post">
<DIV align=center>
<TABLE cellSpacing=0 cellPadding=5 width="100%"
align=center bgColor=#999999 border=0>
<TBODY>
<TR class=style37 vAlign=top align=left>
<TD width="42%" bgcolor="#000000" scope=col><span class="style2">Name </span><BR>
<INPUT
id=name size=22 name=name>
<SPAN
class=style33><SPAN
class=style31>Email<BR>
<INPUT id=email size=22
name=email>
Location<BR>
<INPUT id=location
size=22 name=location>
</SPAN></SPAN></TD>
<TD width="58%" bgcolor="#000000" scope=col><SPAN
class=style33><SPAN class=style31>Song <BR>
<INPUT id=song size=22 name=song>
<BR>
Artist</SPAN><BR>
<INPUT id=artist size=22
name=artist>
<SPAN
class=style31><BR>
Album</SPAN> <BR>
<INPUT
id=album size=22 name=album>
</SPAN></TD>
</TR>
<TR class=style37 vAlign=top align=left>
<TD colSpan=2 bgcolor="#000000" scope=col><DIV class=style37 align=right>
<DIV align=left><SPAN
class=style33></SPAN></DIV>
</DIV>
<SPAN
class=style33></SPAN><SPAN class=style33></SPAN>
<TABLE cellSpacing=0 cellPadding=0 width="100%"
border=0>
<TBODY>
<TR>
<TD scope=col width="50%"><span class="style2">Dedication Message</span><BR>
<SPAN
class=style33>
<TEXTAREA id=message name=message rows=5 wrap=VIRTUAL cols=43></TEXTAREA>
</SPAN></TD>
<TD scope=col width="50%"> </TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
<br>
<label>
<input type="submit" name="Submit" value="Send Request">
</label>
</DIV>
</FORM>
</TD>
</TR>
</TBODY>
</TABLE>
and here is the php code to go with the code above i know the fields are wrong but even when i sort them it still dosent work.
PHP Code:
<?php
if(isset($_POST['submit'])) {
$to = '[email protected]';
$from = '[email protected]';
$sender = 'Sales Team';
$subject = 'Order Expert Package';
$name_field = $_POST['name'];
$domain_field = $_POST['domain'];
$username_field = $_POST['username'];
$pass_field = $_POST['password'];
$email_field = $_POST['email'];
$message = $_POST['message'];
$body = " Name: $name_field\nDomain: $domain_field\n Username: $username_field\n Password: $pass_field\n Contact E-Mail: $email_field\n Message:\n $message";
$headers = "Reply-to: <$from>\n"; // Header Part (HP) 1
$headers .= "From: \"$sender\" <$to>\n"; // HP 2
$headers .= "Return-Path: <$from>\n"; // HP 3
$headers .= 'Message-ID: <' . md5( uniqid( time() ) ) . "@" . str_replace( 'www' , '' , $_SERVER['HTTP_HOST'] ) . ">\n"; // HP 4
$headers .= "MIME-Version: 1.0\n"; // HP 5
$headers .= "Content-type: text/plain; charset=iso-8859-1\n"; // HP 6
$headers .= "Content-transfer-encoding: 8bit\n"; // HP 7
$headers .= 'Date: ' . gmdate( 'D, d M Y H:i:s Z' , time() ) . "\n"; // HP 8
$headers .= "X-Priority: 3\n"; // HP 9
$headers .= "X-MSMail-Priority: Normal\n"; // HP 10
$headers .= "X-Mailer: PHP\n"; // HP 11
$headers .= "X-MimeOLE: Script modified by Beaver6813(Must be left for legal use)\n"; // HP 12
if ( mail( $to , $subject , $body , $headers ) )
{
echo 'Thank you Your Information Has Been Received! <br><br>Please click on the link below to make your payment. Please remember to put £15.00 in the Amount box. You can use your Debit or Credit card to make the payment.<br>
<br><A target="_blank"HREF="http://www.nochex.com/[email protected]"><IMG border="0" SRC="http://www.mbserve.com/images/orderblue.gif"></A>';
}
else
{
echo 'Mail not sent, reason unknown.';
}
}
?>
Last edited by Jamie_Garland; Aug 7th, 2006 at 04:54 PM.
-
Aug 7th, 2006, 11:58 AM
#2
Addicted Member
Re: minor email form help please
PHP is case sensitive. The name of your submit button is "Submit". In your PHP code you need to change:
[code]
if(isset($_POST['submit']))
[\code]
to:
[code]
if(isset($_POST['Submit']))
[\code]
That will allow you to enter that If statement
-
Aug 7th, 2006, 01:52 PM
#3
Re: minor email form help please
Hash lookups are case sensitive they're just strings). Variable names are, I think, case sensitive. Class and function names, as well as keywords, are not. PHP is weird like that.
They want to go completely case sensitive in PHP6.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Aug 7th, 2006, 04:54 PM
#4
Thread Starter
Frenzied Member
Re: minor email form help please
thanks for the help it works thank you..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|