How can I write Javascript in PHP file?

How can I write Javascript in PHP file?
0.0 0


Hi, I am trying to write JavaScript error message code in PHP file, but I get error messages and I followed the instruction but I can make it work. Does anyone know how to write Javascript in PHP file?

This is the code…

<?php include_once 'header.php'; ?> <?php echo ""; ?>

and this is the error message…

Parse error: syntax error, unexpected '"){ ’ (T_CONSTANT_ENCAPSED_STRING), expecting ‘,’ or ‘;’ in C:\wamp64\www\registration-form.php on line 13

Thank you!


You have not posted any JavaScript code, so I assume it is in header.php or the overall file registration-form.php. You need to post all the code of registration-form.php and any other included file (i.e. header.php) , so we can help debug your error.


Thank you for reply. I figure out.