Quick php title code

Discussion in 'PHP' started by fadetoblack22, Oct 19, 2011.

  1. #1
    In my email php file there is the follow code:

         $bodyMsg .= _L('Subject').': '.$data['SUBJECT']."\n";
          $bodyMsg .= _L('Name')   .': '.$data['NAME']."\n";
          $bodyMsg .= _L('Email')  .': '.$data['EMAIL']."\n";
          $bodyMsg .= _L('Date')   .': '.gmdate ('Y-m-d H:i:s')."\n";
    Code (markup):
    I want to add another $bodyMsg line with the site name in it.

    How do I do that?
     
    fadetoblack22, Oct 19, 2011 IP
  2. Einheijar

    Einheijar Well-Known Member

    Messages:
    539
    Likes Received:
    13
    Best Answers:
    3
    Trophy Points:
    165
    #2
    
      $bodyMsg .= _L('Subject').': '.$data['SUBJECT']."\n"; 
         $bodyMsg .= _L('Name')   .': '.$data['NAME']."\n";      
    $bodyMsg .= _L('Email')  .': '.$data['EMAIL']."\n";   
    $bodyMsg .= $SITENAMEGOESHERE."\n";   
       $bodyMsg .= _L('Date')   .': '.gmdate ('Y-m-d H:i:s')."\n"; 
      
    PHP:
     
    Einheijar, Oct 19, 2011 IP
  3. fadetoblack22

    fadetoblack22 Well-Known Member

    Messages:
    2,399
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    160
    #3
    Thanks for the reply. I've tried it and for some reason the email output by the code just puts a blank line instead of "SITENAMEGOESHERE".

    Do you know why?
     
    fadetoblack22, Oct 19, 2011 IP
  4. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #4
    Did you tell the script what $sitenamegoeshere was equal to ?

    
    
    $SITENAMEGOESHERE = 'ThisSite.com';
    
    $bodyMsg .= _L('Subject').': '.$data['SUBJECT']."\n";
         $bodyMsg .= _L('Name')   .': '.$data['NAME']."\n";      
    $bodyMsg .= _L('Email')  .': '.$data['EMAIL']."\n";  
    $bodyMsg .= $SITENAMEGOESHERE."\n";  
       $bodyMsg .= _L('Date')   .': '.gmdate ('Y-m-d H:i:s')."\n";
    
    PHP:
     
    MyVodaFone, Oct 19, 2011 IP
  5. fadetoblack22

    fadetoblack22 Well-Known Member

    Messages:
    2,399
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    160
    #5
    Thanks. No I didn't put that in before. I didn't know I had to. It works now :)
     
    fadetoblack22, Oct 20, 2011 IP