zechdc Posted November 30, 2007 Share Posted November 30, 2007 Here is my code and for some reason it will not forward to the page i want it to. $site is getting set ive tested it but what is the problem then? Can I not insert php into javascript? <?php $site = "neon_score3.php"; ?> <script type="text/javascript">document.location.href='<?php $site;?>'</script> Link to comment https://forums.phpfreaks.com/topic/79623-solved-php-inside-of-javascript-problem/ Share on other sites More sharing options...
phpSensei Posted November 30, 2007 Share Posted November 30, 2007 Here is my code and for some reason it will not forward to the page i want it to. $site is getting set ive tested it but what is the problem then? Can I not insert php into javascript? <?php $site = "neon_score3.php"; ?> <script type="text/javascript">document.location.href='<?php $site;?>'</script> Change <script type="text/javascript">document.location.href='<?php $site;?>'</script> to <script type="text/javascript">document.location.href='<?php echo $site;?>'</script> Link to comment https://forums.phpfreaks.com/topic/79623-solved-php-inside-of-javascript-problem/#findComment-403260 Share on other sites More sharing options...
zechdc Posted December 1, 2007 Author Share Posted December 1, 2007 Thanks that helps alot!!! Link to comment https://forums.phpfreaks.com/topic/79623-solved-php-inside-of-javascript-problem/#findComment-403383 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.