Nov 18th, 2002, 06:35 AM
#1
Thread Starter
Hyperactive Member
Help!
I think I have made a simple php mail page...
The first page works fine.
I just enter
http://my.server.name/test/mailtest...0Mailing%20List
and everything works great.
the problem starts when I click the submit button.
I want to pass the variables entered in mailtest.php to action.php and mail them to myself.
if I put
<?
$subject = "Test";
$message = '
<html>
<head>
<title><?php echo $_POST["subject"]; ?></title>
</head>
<body>
Name: <?php echo $_POST["FName"]; ?> <?php echo $_POST["LName"]; ?> <br>
Email: <?php echo $_POST["Email"]; ?> <br>
Address: <?php echo $_POST["Address"]; ?><br>
<?php echo $_POST["City"]; ?><?php echo $_POST["State"]; ?><?php echo $_POST["Zip"]; ?>
</body>
</html>
';
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: RCW-ONLINE.COM <
[email protected] >\r\n";
?>
<?
mail("
[email protected] ", $subject, $message, $headers);
?>
I'm sent a quote of the text in $message
if I put
<?
$subject = "Test";
$message =
<html>
<head>
<title><?php echo $_POST["subject"]; ?></title>
</head>
<body>
Name: <?php echo $_POST["FName"]; ?> <?php echo $_POST["LName"]; ?> <br>
Email: <?php echo $_POST["Email"]; ?> <br>
Address: <?php echo $_POST["Address"]; ?><br>
<?php echo $_POST["City"]; ?><?php echo $_POST["State"]; ?><?php echo $_POST["Zip"]; ?>
</body>
</html>
;
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: RCW-ONLINE.COM <
[email protected] >\r\n";
?>
<?
mail("
[email protected] ", $subject, $message, $headers);
?>
Nothing happens
Can anyone help? I new to php I have only been doing it for little over 18 hours.
I have included my files in a zip...
Attached Files
[VBCODE]
Option Explicit
Dim XXX As Porn
Dim Wife As Nag
Private Sub *****_Resize()
On Error Resume Next
Get Viagra
End Sub
[/VBCODE]
Nov 18th, 2002, 10:42 AM
#2
Frenzied Member
for one you can't have php tags inside php tags.
<? //start php
$subject = "Test";
$message = <html> <head> <title><?php echo $_POST["subject"]; ?></title>
see the bold? you can't do that. you also need quotes. you also have your headers backwards. you don't need the mime header either. try this, also why have a title if you can never see it?
PHP Code:
<?
$subject = "Test";
$message = "
<html>
<head>
<title>$_POST["subject"]</title>
</head>
<body>
Name: $_POST["FName"] . $_POST["LName"] <br>
Email: $_POST["Email"] <br>
Address: $_POST["Address"]<br>
$_POST["City"] . $_POST["State"] . $_POST["Zip"]
</body></html> ";
$headers = "From: RCW-ONLINE.COM <[email protected] >\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
mail("[email protected] ", $subject, $message, $headers);
?>
Nov 18th, 2002, 11:15 AM
#3
Fanatic Member
No offense phpman but that wouldnt work,
PHP Code:
<?
$subject = "Test";
$message = "
<html>
<head>
<title>{$_POST["subject"]}</title>
</head>
<body>
Name: {$_POST["FName"]} {$_POST["LName"]} <br>
Email: {$_POST["Email"]} <br>
Address: {$_POST["Address"]}<br>
{$_POST["City"]} {$_POST["State"]} {$_POST["Zip"]}
</body></html> ";
$headers = "From: RCW-ONLINE.COM <[email protected] >\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
mail("[email protected] ", $subject, $message, $headers);
?>
Nov 18th, 2002, 11:23 AM
#4
Frenzied Member
it will work, it's just that the values wouldn't have spaces is all.
the concatenators (sp) work all the time, but I still shouldn't have used them.... wait I get what you are saying
it would get a T_STRING error, huh?
should have used ".$_POST[]." instead or the way you did it.
good catch Matt.
Nov 18th, 2002, 02:23 PM
#5
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