answersLogoWhite

0

No. PHP runs on the server. It receives a http request from the web server, and sends output (typically as html) to the browser.

Any code in an onclick event would be handled by javascript. To send data back to the webserver (and PHP) you can make a synchronous request (AJAX) from an onclick, or any other browser event.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

You use a Html button in Php on its onclick you made a function but its not responding?

this is not really a question... But I think you are asking why php functions inside a HTML button do not work. Well probably because php is rendered serverside and is passed to a user-browser afterwards.... it is possible to use php inside onclick... but only to display specific content (javascript function for instance)... it is not possible to let a user decide to run a specific php function by clicking a button.


How do you put HTML in PHP?

Its done exactly the same as when you put it in an HTML file. There are 2 ways you can do it: <html> <?php // php stuff ?> </html> Or you can do it like this: <?php echo "<html>"; // php stuff echo "</html>"; ?>


How do you use PHP in HTML?

You can't use PHP in an HTML document, but you can use HTML in PHP script.


How do you use a function with a button in PHP?

A simple function call <html> <body> <?php if(isset($_POST['button'])) { setValue(); // Function is called } function setValue() { echo "<br>The button property to call PHP function works"; // Your code here } ?> <input type="submit" name="button" onclick=<?php $_SERVER['PHP_SELF']; ?> /> </body> </head>


I have a HTML website I want to use a php script I have but the main php file has the info in it and I want it to be on the HTML site how can I embed or use the php code without using frames?

change the extention of the .HTML file to .php and then open the file that was previously HTML and put <?php include ("path/to/second/php/file.php"); ?> so for example if i have page1.HTML and page2.php i rename page1.HTML to page1.php and then put <?php include ("page2.php"); ?> where i want page2 to appear. Note: Any HTML file can be renamed to have a .php extention even if it doesnt contain any PHP.


How do you go from HTML form to php?

Build your form in HTML and specify your PHP file in the action of the document. HTML does the form stuff, PHP the processing (although you can - of course - use HTML inside PHP via print() or echo(), too)


How do you show dynamic time in a HTML page?

It is not possible to do it with HTML alone, you have to use Javascript, PHP or another scripting language that has the time as a built in function.


What are the various ways to embedded PHP in HTML coding?

there are in fact two basic methods - one is called minimal PHP, and the second tends to be referred to as the CGI-way. minimal php means that you're making php secions in HTML only where really necessary (using the php section begin (<?php ) and end (?> ) tags.). the CGI-way, or maximum PHP means, that you're in fact embedding HTML into strings in php, and the whole page is echo()ed. the second way tends to be viewed as an abuse of php by some people, as php was meant to be "templating" language, and designed to be used mainly the first way.


How does PHP differ from HTML in terms of application and structure?

In structure <?php ?> <html> </html> in application - one is static and another is dynamic. this much ......


What does PHP include in terms of html coding?

To do programming in PHP, there is often the dilemma of whether or not to place the code within the HTML. Depending on the writer's coding experience it is usually better to place the PHP within the HTML.


Does netscape support php?

PHP support is not up to the clients (browsers). If it runs on the server, then HTML is served to the client. PHP may have generated the HTML, but that does not matter to the client.


Can a php file be valid without any php code?

PHP files are HTML files with any amount of PHP intermingled into it, so the file can be empty or only contain HTML and be valid, yes.