www.webdeveloper.com
Results 1 to 6 of 6

Thread: error message

Hybrid View

  1. #1
    Join Date
    Mar 2003
    Posts
    432

    Question error message

    Howdy~
    Here is my short php code and now sure why I get the error message:
    Parse error: syntax error, unexpected $end in /home/content/28/8455828/html/tellafriend.php

    PHP Code:
    <?php
    if(count($_POST)) {
    foreach(array(
    'friendmail1','friendmail2','friendmail3','email','name') as $key$_POST[$key] = strip_tags($_POST[$key]);
    if(!
    is_secure($_POST)) { die("Asta la vista Hacker");}
    $emailto "me@mysite.com"
    $esubject "A page has been sent"

    $emailtext "
    $_POST[name] has used the tell-a-friend form. Their email address is $_POST[email]

    The people they have recommended your site to are:
    $_POST[friendmail1]
    $_POST[friendmail2]
    $_POST[friendmail3]
    "
    ;
    @
    mail("$emailto"$esubject$emailtext"From: $_POST[email]");
    $thankyoupage "/thankyou.html"
    $tsubject "A web site recommendation from $_POST[name]";
    $ttext "
    Hello,

    A friend of yours, 
    $_POST[name] , whose email address is $_PO[email] likes http://mysite.com
    ?>
    Thanks for ya help on this
    Tasmanian

  2. #2
    Join Date
    Mar 2012
    Posts
    22
    You should to close $ttext string with a ";

  3. #3
    Join Date
    Feb 2012
    Posts
    218
    You may have cut your ending part of the script. First thought it's indeed, close $ttext string. But as I see, it should also be followed by another call to mail(), after that a closing braket and so on. Be sure you copied all the script.

  4. #4
    Join Date
    Mar 2003
    Posts
    432
    PHP Code:
    <?php
    if(count($_POST)) {

    foreach(array(
    'friendmail1','friendmail2','friendmail3','email','name') as $key$_POST[$key] = strip_tags($_POST[$key]);
    if(!
    is_secure($_POST)) { die("Asta la vista Hacker");}

    $emailto "me@mysite.com"
    $esubject "A page has been sent"
    $emailtext "
    $_POST[name] has used the tell-a-friend form. Their email address is $_POST[email]

    The people they have recommended your site to are:
    $_POST[friendmail1]
    $_POST[friendmail2]
    $_POST[friendmail3]
    "
    ;

    @
    mail("$emailto"$esubject$emailtext"From: $_POST[email]");
    $thankyoupage "/thankyou.html"
    $tsubject "A web site recommendation from $_POST[name]";
    $ttext "
    Hello,

    A friend of yours, 
    $_POST[name] , whose email address is $_PO[email] likes http://mysite.com and thought you might like the site as well.;
    ?>
    That is my entire code but now getting an error message:
    Parse error: syntax error, unexpected $end in /home/content/28/8455828/html/tellafriend.php

    Thanks

  5. #5
    Join Date
    Jan 2006
    Location
    MN
    Posts
    440
    $ttext needs to end with well."; not well.;

  6. #6
    Join Date
    Mar 2003
    Posts
    432
    Howdy~
    I am doin something wrong adjusted everything like mentioned and still gettin error message:
    Parse error: syntax error, unexpected $end in /home/content/28/8455828/html/tellafriend.php

    Any ideas¿
    Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles