How can you insert javascript in php code?

Answer Posted / sivarajan

<?php echo "<script>alert('Insert Javascript in PHP');
</script>"; ?>

Is This Answer Correct ?    55 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When viewing an html page in a browser, the browser often keeps this page in its cache. What can be possible advantages/disadvantages of page caching? How can you prevent caching of a certain page (please give several alternate solutions)?

734


Explain me what is x+ mode in fopen() used for?

738


Explain how we can get the number of elements in an array?

709


What is mysql_fetch_array?

704


How can we submit a form without using submit buttons?

718


How to access a specific character in a string using php?

727


What are the different components used in php for formatting?

729


Can you use php and javascript together?

747


What are the different data types in javascript?

863


What is xss and csrf?

685


How to get the directory name out of a file path name?

702


How come the code works, but doesn’t for two-dimensional array of mine?

785


Explain Type juggling?

749


How does session work in php?

729


How to replace a substring in a given string?

714