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
asked Dec 3, 2013 at 23:20
user3063668
551 gold badge1 silver badge4 bronze badges
1 Answer 1
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>';
?>
answered Dec 3, 2013 at 23:22
evuez
3,4074 gold badges31 silver badges46 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
default