0

So we got 2 types of tags which my lecture finds me wrong of using when we talking about php

Which one belongs to the other ?

<body>
<script src="myPhp.php">
Echo
</script>
</body>

&

<body>
<?php
Echo
 ?>
</body>

My lecturer is marking me wrong for using the first tag in my php exam😭😭😭

1 Answer 1

3

The <script src="xxxx"></script> statement in a HTML file is used for including an external Javascript (JS) file, such as

<script src="myscripts.js"></script>

to include another PHP file (in a PHP file), you need something like

<?php include "myPhp.php"; ?>

Please note that Javascript is a client-side language and PHP is a server-side language, so make sure you understand what you are trying to accomplish when using them.

For further reference, you may see what-is-the-use-of-javascript and what is PHP and other related articles

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.