Jump to content


Photo

I Keep Gettin An Error :( Summat To Do With T-string


  • Please log in to reply
3 replies to this topic

#1 runnerjp

runnerjp
  • Members
  • PipPipPip
  • Advanced Member
  • 2,214 posts

Posted 29 June 2006 - 05:40 PM

hey all im setting up a login script and when i got to the [a href=\"http://werun2win.com/main.php\" target=\"_blank\"]main page [/a]
i get the error
Parse error: syntax error, unexpected T_STRING in /home/werun2wi/public_html/include/mailer.php on line 25



here is script.... wats wrong with it ????

<? 
/**
 * Mailer.php
 *
 * The Mailer class is meant to simplify the task of sending
 * emails to users. Note: this email system will not work
 * if your server is not setup to send mail.
 *
 * If you are running Windows and want a mail server, check
 * out this website to see a list of freeware programs:
 * <http://www.snapfiles.com/freeware/server/fwmailserver.html>
 *
 * Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC)
 * Last Updated: August 19, 2004
 */
 
class Mailer
{
   /**
    * sendWelcome - Sends a welcome message to the newly
    * registered user, also supplying the username and
    * password.
    */
   function sendWelcome($user, $email, $pass){
      $from = "From: ".WERUN2WIN ADMIN." <".WERUN2WIN@WERUN2WIN.COM.">";
      $subject = "WELCOME 2 WERUN2WIN";
      $body = $user.",\n\n"
             ."Welcome! You've just registered at WERUN2WIN "
             ."with the following information:\n\n"
             ."Username: ".$user."\n"
             ."Password: ".$pass."\n\n"
             ."If you ever lose or forget your password, a new "
             ."password will be generated for you and sent to this "
             ."email address, if you would like to change your "
             ."email address you can do so by going to the "
             ."My Account page after signing in.\n\n"
             ."- WERUN2WIN";

      return mail($email,$subject,$body,$from);
   }
   
   /**
    * sendNewPass - Sends the newly generated password
    * to the user's email address that was specified at
    * sign-up.
    */
   function sendNewPass($user, $email, $pass){
      $from = "From: ".WERUN2WIN." <".WERUN2WIN@WERUN2WIN.COM.">";
      $subject = "werun2win - Your new password";
      $body = $user.",\n\n"
             ."We've generated a new password for you at your "
             ."request, you can use this new password with your "
             ."username to log in to WERUN2WIN.\n\n"
             ."Username: ".$user."\n"
             ."New Password: ".$pass."\n\n"
             ."It is recommended that you change your password "
             ."to something that is easier to remember, which "
             ."can be done by going to the My Account page "
             ."after signing in.\n\n"
             ."- WERUN2WIN";
             
      return mail($email,$subject,$body,$from);
   }
};

/* Initialize mailer object */
$mailer = new Mailer;
 
?>


#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 29 June 2006 - 06:02 PM

You sure its this script? As I get no errors.

#3 Buyocat

Buyocat
  • Members
  • PipPipPip
  • Advanced Member
  • 267 posts

Posted 29 June 2006 - 06:04 PM

WERUN2WIN ADMIN that is most likely the problem, your error means that it found a text string where it shouldn't have. Right there, I'm not sure if you are trying to use a constant, but it has a space in it so it screws up the thing. If it isn't a constant then just put it in quotes.
Looking for some easy-to-use tools?  Try these, https://sourceforge....jects/utils-php -- I made them myself.  They're distinct tools which are easy to understand and use.  See some examples uses at http://www.anotherearlymorning.com

#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 29 June 2006 - 07:25 PM

<".WERUN2WIN@WERUN2WIN[!--sizeo:5--][span style=\"font-size:18pt;line-height:100%\"][!--/sizeo--].[!--sizec--][/span][!--/sizec--]COM.">";

That's your problem. The . between the domain name and com is interpreted as a concatenation operator.
Legend has it that reading the manual never killed anyone.
My site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users