adspace


How to write php function in html onclick?

Answer Posted / Zia Ur Rehman

You can call a PHP function from HTML using JavaScript by attaching an event listener to the HTML element. Here's an example: `<button onclick='myFunction()'>Click me</button>` and then define your PHP function like this: `function myFunction() { <?php echo 'Hello, World!'; ?> }`

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Name and explain five of the PHP error constants?

1043


sort term descripttion form, report and uery

2257


hello all, I need some sample placement papers in lion bridge.. can anyone help me?

2181


How can we extract string "pcds.co.in" from a string "https://info@pcds.co.in" using regular expression of php? More on reg can you explain

1082


How to create a web form?

1116


Tell me what kind of things have you done on the social side?

1071


List some features of php that are deprecated in php7?

1026


What is the current stable version of php? What advance thing in php7?

1100


What is the difference between htmlentities() and htmlspecialchars()?

1100


What is difference between static and final in php?

1114


What is the current stable version of php?

1130


Write a program using while loop?

1128


What does $_files means?

1170


What sized websites have you worked on in the past?

1092


Explain me is it possible to destroy a cookie?

1035