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 4 of 4
  1. #1
    New Coder
    Join Date
    Mar 2009
    Posts
    43
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Sending an email:

    PHP Code:
        {
            
    $text "Hello, $a['name']\n\n";
            
    $text .= "This email contains trusted information.\n";
            
    $text .= "Do not share this email with someone.\n";
            
    $text .= "Your password will be unique,\n";
            
    $text .= "You can change it ingame or throught the website\n";
            
    $text .= "This is your new password:\n";
            
    $text .= "$password";
            
    $text .= "\nRegards,";
            
    $text .= "\n$sitename, $siteowner";
            
    $text .= "\n\n\n";
            
    $text .= "This is an automatic generated email do not answer.";
            
    mail($a['email'], "New password"$text$header);
        } 
    Code:
    Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /process.php on line 37
    whats wrong? :X

  • #2
    Gütkodierer
    Join Date
    Apr 2009
    Posts
    2,127
    Thanks
    1
    Thanked 426 Times in 424 Posts
    I guess it's the line
    PHP Code:
    $text "Hello, $a['name']\n\n"
    that's producing the error?

    Change it to
    PHP Code:
    $text "Hello, ".$a['name']."\n\n"
    or
    PHP Code:
    $text "Hello, {$a['name']}\n\n"
    and it should work.

  • Users who have thanked venegal for this post:

    Pandabeer (05-03-2009)

  • #3
    New Coder
    Join Date
    Mar 2009
    Posts
    43
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thanks, worked :d but now this :

    PHP Code:
    include 'sitevars.php';

            
    $text .= "\n".$text['sitename']." and ".$text['siteowner'].".";

    // sitevars.php :
    $text['sitename'] = "Digital-RP";
    $text['siteowner'] = "Pandabeer1337"
    gives this:

    Code:
    H and H.
    Whats wrong now :X

  • #4
    Gütkodierer
    Join Date
    Apr 2009
    Posts
    2,127
    Thanks
    1
    Thanked 426 Times in 424 Posts
    I don't see how it would give "H and H.".

    Anyway, since you are using global variables everywhere, you can't use the variable $text for your string, if it's already your array.


  •  

    Posting Permissions

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