0
Well my question is if it is possible to add a code
If not, how can I make it possible.
Thank you
0
Well my question is if it is possible to add a code
If not, how can I make it possible.
Thank you
2
Rename the . js file to . php, after that, at the beginning of the file, add the following.
<?php
header("Content-type: text/javascript");
?>
Now you can include PHP code both within these tags we created, as in any other part of the file, remembering to follow the basic rules of PHP.
This file will go through the PHP interpreter before it is sent to the client (as with a .php file with HTML, for example), and when it gets to the client, it will be a file. js common.
Browser other questions tagged php javascript
You are not signed in. Login or sign up in order to post.
Well, in case it’s the other way around I want to write php, in a javascript code.
– Gonçalo
If the FILE is . php, you can include a php code within the js code... but if the file is js... no.
– Andrei Coelho
So, there’s no way? I have to pass js to the right.php file?
– Gonçalo
right... I think it’s the only way
– Andrei Coelho