Results 1 to 5 of 5

Thread: Help!

  1. #1

    Thread Starter
    Hyperactive Member New to VB 6's Avatar
    Join Date
    Apr 2002
    Posts
    362

    Question 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 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]

  2. #2
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    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); 
    ?>

  3. #3
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    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); 
    ?>
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

  4. #4
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    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.

  5. #5
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    I figured you would see that after my post, I guess I should have stated it as well
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width