SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist
    Join Date
    Feb 2009
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    unexcepted error

    I keep getting this error:

    Code:
    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /homepages/30/d211652780/htdocs/HTML/mailer.php on line 25
    and I am not sure how I fix. Here is the php file that is being used:

    http://pastebin.com/m7425017

    Website contact page:

    http://www.naspos.com/HTML/contact.html

    That's where the php file is used.

    Can anyone please help me?

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)
    Even though they're after the "don't change" line, the extraneous semi-colons and double quotes look wrong. Maybe?
    PHP Code:
    <?php
    //variables (change these)
    $youremail "vlad@naspos.com";

    // your email address
    $subject "Subject";

    // the subject of the email
    $email_field $_POST['email'];

    // thank you page
    $thankyou "thankyou.html";
     
    // don't change anything else

    if($email == "")
    {
    ?>
        No email address added. Please go back.<br/>
    <?php
    }
    elseif(
    $name == "")
    {
    ?>
        No name added. Please go back.<br/>
    <?php
    }
    elseif(
    $message == "")
    {
    ?>
        No message added. Please go back.<br/>
    <?php
    }
    else
    {
        
    $msg ereg_replace("\\\'""'"$message);
        
    $msg ereg_replace('\\\"'"\""$msg);
        
    $message1 "from: $name\nemail: $email\nmessage:\n$msg1";
        
    mail($youremail$subject$msg"From: $email\r\nReply-to: $email\r\n");
    ?>
        <meta http-equiv="refresh" content="0; url=<?echo $thankyou;?>"">
    <?php
    }
    ?>

  3. #3
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Notice how the syntax highlighting after line 25 happens to be the same color as a string? You have a stray " at the end of that line.

  4. #4
    SitePoint Evangelist
    Join Date
    Feb 2009
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks it worked! im still a php noob, there were extra quotes.


Bookmarks

Posting Permissions

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