Parse error: syntax error, unexpected T_CONSTANT

Hi,

I am getting this error message:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/artpaint/public_html/includes/languages/portugues/contact_us.php on line 40

corresponding to line, document.write(‘<a href="mailto:’+encryptedemail_id68+‘">’+encryptedemail_id68+‘</a>’)

from this code:


define('MAIN_TEXT', '
  <script type="text/javascript">

var emailriddlerarray=[105,110,102,111,64,97,114,116,112,97,105,110,116,105,110,103,52,121,111,117,46,101,117]
var encryptedemail_id68=''
for (var i=0; i<emailriddlerarray.length; i++)
 encryptedemail_id68+=String.fromCharCode(emailriddlerarray[i])

document.write('<a href="mailto:'+encryptedemail_id68+'">'+encryptedemail_id68+'</a>')

</script>');

I already tried to escape every ’ with \’ but then I get these errors

Warning: Unexpected character in input: ‘’’ (ASCII=39) state=1 in /home/artpaint/public_html/includes/languages/portugues/contact_us.php on line 32

Parse error: syntax error, unexpected ‘<’ in /home/artpaint/public_html/includes/languages/portugues/contact_us.php on line 33

Please help me.
Thanks

Thank you very much for your help. It’s working beautiful :slight_smile:

Finally I figured it out. I’m very slow I haven’t sleep all night.

Thanks :slight_smile:

Compare your first post, with the one I posted. :wink:

Hopefully you’ll spot the differences…

Thanks for your help, but it stills shows an error:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/artpaint/public_html/includes/languages/portugues/contact_us.php on line 35

The full code is this:


define('MAIN_TEXT', '<p class="text-main"><span class="text-main-Red">Abcd</span><br>
Rua das Pereiras, Lote 93<br>
<br>
  <span class="text-main-Red">Email:</span><br> "<script type=\\"text/javascript\\">    var emailriddlerarray=[105,110,102,111,64,97,114,116,112,97,105,110,116,105,110,103,52,121,111,117,46,101,117]    var encryptedemail_id68=''    for (var i = 0; i < emailriddlerarray.length; i++){      encryptedemail_id68 += String.fromCharCode(emailriddlerarray[i])    }    document.write('<a href=\\"mailto:'+encryptedemail_id68+'\\">'+encryptedemail_id68+'</a>')  </script>"
  <br>
  <span class="text-main-Red">Site:<br>
</span>Aabcd<br>
<p class="text-main">Para sua conveni&#234;ncia utilize este formul&#225;rio...');

It points to this line:


  <span class="text-main-Red">Email:</span><br> "<script type=\\"text/javascript\\">    var emailriddlerarray=[105,110,102,111,64,97,114,116,112,97,105,110,116,105,110,103,52,121,111,117,46,101,117]    var encryptedemail_id68='

Thanks

I think the syntax highlighting above points to your problem… :wink:


<?php
define(
  'MAIN_TEXT',
  "<script type=\\"text/javascript\\">
    var emailriddlerarray=[105,110,102,111,64,97,114,116,112,97,105,110,116,105,110,103,52,121,111,117,46,101,117]
    var encryptedemail_id68=''
    for (var i = 0; i < emailriddlerarray.length; i++){
      encryptedemail_id68 += String.fromCharCode(emailriddlerarray[i])
    }
    document.write('<a href=\\"mailto:'+encryptedemail_id68+'\\">'+encryptedemail_id68+'</a>')
  </script>"
); 
?>