0

hello im trying to display javascript content in php, but i get only javascript raw code i need get actually javascript content for example in html when i put :

<script type="text/javascript" src="https://www.cpagrip.com/script_include.php?id=25002&tracking_id="></script>

then its normal but when im trying to display content in paticular place like this:

<?php
$content = file_get_contents('https://www.cpagrip.com/script_include.php?id=25002&tracking_id=');
echo $content;
?>

it showing me raw code

1 Answer 1

2

Add a <script> tag:

<?php
$content = file_get_contents('https://www.cpagrip.com/script_include.php?id=25002&tracking_id=');
echo '<script type="text/javascript">' . $content . '</script>';
?>
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.