Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts

    Sending Email in PHP trouble

    hello,
    I'm tyring to send an email in PHP,
    but having trouble with the body of the email,
    it looks like it can't have any ''' in it.
    If i remove them, everything works again.

    my error code:

    Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /signup.php on line 63

    how can i get around this to properly format the message?


    thanks in advance for your time!
    -Ken

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Location
    West Midlands, UK
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try escaping them with a backslash \ - this will allow PHP to include them without parsing them.

  • #3
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    hmm, ok and how would that look?

    test'/s or something like that?

  • #4
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    ok, i've got it working now,,
    but when i receive the email i still see the slashes?

    like:

    they'\re

    shouldn't that be removed while sending?

    thanks again for your time!
    -Ken

  • #5
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    ok nm, i've got,

    thanks for your help!

  • #6
    Regular Coder
    Join Date
    Dec 2002
    Location
    a bit west of pittsburgh
    Posts
    236
    Thanks
    1
    Thanked 0 Times in 0 Posts
    have you got it working right?

    the escape character \ is to occur right before the character that needs to be escaped.
    $text = "Vocab lesson: Your mom\'s sister is your \"aunt\"";

  • #7
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    hello,
    maybe you could help me with one other small thing,

    just trying to setup a very simple login with the user and pass coded, insted of using a db.

    trying to use this:

    PHP Code:

    <?php

    $user 
    $_POST['user'];
    $pass $_POST['pass'];

    if ( 
    $user == "admin" and $pass == "admin" ) {

    header("Location: admin/admin.php");

    } else {

    header("Location: admin/index.php?error=login");


    }


    ?>
    but i keep getting errors for some reason.

    Notice: Undefined index: user in login.php on line 3

    Notice: Undefined index: pass in login.php on line 4

    Warning: Cannot modify header information - headers already sent by (output started at login.php:3) in login.php on line 12

    i've been doing google searches and can't come up with anything yet.
    I'm still very new to php coding. just moving over from ASP/VB, so i know that these things can be done, but syntax is a *****!

    thanks again for your time!
    -Ken


  •  

    Posting Permissions

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