[Resolved] Need Help (Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in..)

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
Watch

jagdotme

Top Member
Impact
602
Need Help (Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in..)

Hi

When people go on my site and try to Create Account they get this message >>


Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/XxXxX/public_html/your_details.php on line 312



(XxXxX is a user name thats been covered up by me)

the code for line 312 >>>>>

$buildEmail='Hi,<br>A new account was created today for '. $name . '<br><br>' . $name . '\'s email address is <a href=mailto:' . $email_address . '>' . $email_address . '</a>';


Hope someone can help
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
JagG said:
$buildEmail='Hi,<br>A new account was created today for '. $name . '<br><br>' . $name . '\'s email address is <a href=mailto:' . $email_address . '>' . $email_address . '</a>';

You cannot use \' in single-quoted string.
I'd recommend you to rewrite this line of code like this:
Code:
$buildEmail = "Hi,<br>A new account was created today for $name. <br><br>$name\'s email address is <a href=\"mailto:$email_address\">$email_address</a>";

Hope this helps.
 
0
Close
Trying your code, Jag, does not produce an error - what is the 2-3 lines before the $buildEmail?

--

Not true. If you have a PHP string 'This is a test. Don\'t'. < that's perfectly valid.

un4given[MAD] said:
You cannot use \' in single-quoted string.
I'd recommend you to rewrite this line of code like this:
Code:
$buildEmail = "Hi,<br>A new account was created today for $name. <br><br>$name\'s email address is <a href=\"mailto:$email_address\">$email_address</a>";

Hope this helps.
 
0
Close
yep, problem is above line 312, post the previous line with code
 
0
Close
nodws said:
yep, problem is above line 312, post the previous line with code

Thank you for the post far, but have to say that I havent changed anything at the moment.

Here are the codes from lines 307-327


//send email
tep_mail($name, $email_address, $email_subject, $buildEmail, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);


//send store owner email
$buildEmail='Hi,</br>A new account was created today for '. $name . '</br><br>' . $name . '\'s email address is <a href=mailto:' . $email_address . '>' . $email_address . '</a>';
tep_mail(STORE_OWNER,STORE_OWNER_EMAIL_ADDRESS, 'New Account Created', $buildEmail, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

tep_redirect(tep_href_link(FILENAME_CHECKOUT_FINAL, '', 'SSL'));
}
}
}

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));

$content = CONTENT_CREATE_ACCOUNT;
$javascript = 'form_check.js.php';
require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);

require(DIR_WS_INCLUDES . 'application_bottom.php');
?>



Cheers Peeps
 
0
Close
no error looks to exist on that line tbh

Presumably STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS are both contsants although this error should not be generated if that were the case as they would be used as a string instead.

Maybe if you send 1 of us the file.
 
0
Close
Peter said:
no error looks to exist on that line tbh

Presumably STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS are both contsants although this error should not be generated if that were the case as they would be used as a string instead.

Maybe if you send 1 of us the file.

Hi Peter,

Im still having trouble, is there anyway i can get this sorted without sending file...I dont really fill safe doing so...sry

J.G
 
0
Close
would need to see the whole file content. 1 thing you could do if you have an editor with syntax highlighting you would be able to see if for example, see if any of those closing brackets do not have corresponding opening brackets.
 
0
Close
Peter said:
would need to see the whole file content. 1 thing you could do if you have an editor with syntax highlighting you would be able to see if for example, see if any of those closing brackets do not have corresponding opening brackets.


How do I send you the file mate??? I`ve given up :(

Peter your a star...... its all sorted now...... Cheers Mate :tu:
 
0
Close
cool JagG glad it is sorted.
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Member card: see how many threads a member started
The member card now shows a Threads number, right after Posts. The member card is the box that opens when you point at a name. Profile...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back