Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-03-2009, 07:29 PM   PM User | #1
Pandabeer
New Coder

 
Join Date: Mar 2009
Posts: 43
Thanks: 2
Thanked 0 Times in 0 Posts
Pandabeer has a little shameless behaviour in the past
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
Pandabeer is offline   Reply With Quote
Old 05-03-2009, 07:41 PM   PM User | #2
venegal
Gütkodierer


 
Join Date: Apr 2009
Posts: 2,127
Thanks: 1
Thanked 426 Times in 424 Posts
venegal has a spectacular aura aboutvenegal has a spectacular aura about
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.
venegal is offline   Reply With Quote
Users who have thanked venegal for this post:
Pandabeer (05-03-2009)
Old 05-03-2009, 08:09 PM   PM User | #3
Pandabeer
New Coder

 
Join Date: Mar 2009
Posts: 43
Thanks: 2
Thanked 0 Times in 0 Posts
Pandabeer has a little shameless behaviour in the past
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
Pandabeer is offline   Reply With Quote
Old 05-03-2009, 08:40 PM   PM User | #4
venegal
Gütkodierer


 
Join Date: Apr 2009
Posts: 2,127
Thanks: 1
Thanked 426 Times in 424 Posts
venegal has a spectacular aura aboutvenegal has a spectacular aura about
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.
venegal is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:59 PM.


Advertisement
Log in to turn off these ads.