Jump to content

Recommended Posts

ahhh can some 1 cheack this as i keep gettin errors :S

Parse error: syntax error, unexpected '@' in /home/werun2wi/public_html/include/mailer.php on line 49

[code]<?
/**
* 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;

?>[/code]
Link to comment
https://forums.phpfreaks.com/topic/13233-unexpected-on-line-42/
Share on other sites

I can see many syntax errors in your post above:
[code]
      $from = "From: ".WERUN2WIN ADMIN." <".WERUN2WIN@WERUN2WIN.COM.">";
[/code]

for example should read:
[code]
      $from = "From: WERUN2WIN ADMIN <WERUN2WIN@WERUN2WIN.COM>";
[/code]

Chris
Link to comment
https://forums.phpfreaks.com/topic/13233-unexpected-on-line-42/#findComment-50945
Share on other sites

Runner you need to look at the strings you're entering and be sure that they are encased in quotation marks, double or single. It looks like throughout the script you use the ' . ' mark to concatenate a string, but that won't work unless the string is in " or ' . I believe this is the source of the current error.
Link to comment
https://forums.phpfreaks.com/topic/13233-unexpected-on-line-42/#findComment-50949
Share on other sites

[!--quoteo(post=389382:date=Jun 29 2006, 01:37 PM:name=lead2gold)--][div class=\'quotetop\']QUOTE(lead2gold @ Jun 29 2006, 01:37 PM) [snapback]389382[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I can see many syntax errors in your post above:
[code]
      $from = "From: ".WERUN2WIN ADMIN." <".WERUN2WIN@WERUN2WIN.COM.">";
[/code]

for example should read:
[code]
      $from = "From: WERUN2WIN ADMIN <WERUN2WIN@WERUN2WIN.COM>";
[/code]

Chris
[/quote]


wahoo thanks m8
just wunderin how can i stick this code

[code]<?
/**
* Main.php
*
* This is an example of the main page of a website. Here
* users will be able to login. However, like on most sites
* the login form doesn't just have to be on the main page,
* but re-appear on subsequent pages, depending on whether
* the user has logged in or not.
*
* Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC)
* Last Updated: August 26, 2004
*/
include("include/session.php");
?>

<html>
<title>WERUN2WIN</title>
<body>

<table>
<tr><td>


<?
/**
* User has already logged in, so display relavent links, including
* a link to the admin center if the user is an administrator.
*/
if($session->logged_in){
   echo "<h1>Logged In</h1>";
   echo "Welcome <b>$session->username</b>, you are logged in. <br><br>"
       ."[<a href=\"userinfo.php?user=$session->username\">My Account</a>] &nbsp;&nbsp;"
       ."[<a href=\"useredit.php\">Edit Account</a>] &nbsp;&nbsp;";
   if($session->isAdmin()){
      echo "[<a href=\"admin/admin.php\">Admin Center</a>] &nbsp;&nbsp;";
   }
   echo "[<a href=\"process.php\">Logout</a>]";
}
else{
?>

<h1>Login</h1>
<?
/**
* User not logged in, display the login form.
* If user has already tried to login, but errors were
* found, display the total number of errors.
* If errors occurred, they will be displayed.
*/
if($form->num_errors > 0){
   echo "<font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font>";
}
?>
<form action="process.php" method="POST">
<table align="left" border="0" cellspacing="0" cellpadding="3">
<tr><td>Username:</td><td><input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"></td><td><? echo $form->error("user"); ?></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"></td><td><? echo $form->error("pass"); ?></td></tr>
<tr><td colspan="2" align="left"><input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?>>
<font size="2">Remember me next time &nbsp;&nbsp;&nbsp;&nbsp;
<input type="hidden" name="sublogin" value="1">
<input type="submit" value="Login"></td></tr>
<tr><td colspan="2" align="left"><br><font size="2">[<a href="forgotpass.php">Forgot Password?</a>]</font></td><td align="right"></td></tr>
<tr><td colspan="2" align="left"><br>Not registered? <a href="register.php">Sign-Up!</a></td></tr>
</table>
</form>

<?
}

/**
* Just a little page footer, tells how many registered members
* there are, how many users currently logged in and viewing site,
* and how many guests viewing site. Active users are displayed,
* with link to their user information.
*/
echo "</td></tr><tr><td align=\"center\"><br><br>";
echo "<b>Member Total:</b> ".$database->getNumMembers()."<br>";
echo "There are $database->num_active_users registered members and ";
echo "$database->num_active_guests guests viewing the site.<br><br>";

include("include/view_active.php");

?>


</td></tr>
</table>


</body>
</html>[/code]
on this page i have made
[a href=\"http://www.werun2win.com/home.html\" target=\"_blank\"]www.werun2win.com/home.html[/a]??
Link to comment
https://forums.phpfreaks.com/topic/13233-unexpected-on-line-42/#findComment-50950
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.