Button clicks are client side whereas PHP is executed server side, but you can achieve this by using Ajax:
$('.button').click(function() { $.ajax({ type: "POST", url: "some.php", data: { name: "John" } }).done(function( msg ) { alert( "Data Saved: " + msg ); }); });
In your PHP file:
<?php function abc($name){ // Your code here } ?>
Related Posts:
- How to call a PHP function on the click of a button
- count(): Parameter must be an array or an object that implements Countable error in php
- count(): Parameter must be an array or an object that implements Countable error in php
- Parse error: Syntax error, unexpected end of file in my PHP code
- Parse error: Syntax error, unexpected end of file in my PHP code
- Parse error: Syntax error, unexpected end of file in my PHP code
- Double click and run the Php script on mac
- localhost/test.php returns nothing
- What are .tpl files? PHP, web design
- How to solve PHP error ‘Notice: Array to string conversion in…’
- How to read if a checkbox is checked in PHP?
- Document Root PHP
- How to use PHP inside css file
- PHP Include Nav-bar For Every Page Techniques?
- How to create a text box in PHP to output data
- HTML vs SHTML vs PHTML
- How to set a border for an HTML div tag
- iframe refuses to display
- Setting table column width
- Why is my Javascript not working?
- How to line-break from css, without using
? - How to put img inline with text
- How to animate GIFs in HTML document?
- How to create uppercase in pure HTML
- How to change text transparency in HTML/CSS?
- How to put text over images in html?
- How to display PDF file in HTML?
- What does the shrink-to-fit viewport meta attribute do?
- What formats can be displayed with type=”application/x-shockwave-flash”
- Placing border inside of div and not on its edge
- Why php tag is not working in html file?
- How to apply CSS to iframe?
- HTML5 required attribute seems not working
- a href link for entire div in HTML/CSS
- Definition of ui-sref in Angular.js?
- mailto using javascript
- Complete list of reasons why a css file might not be working
- How to submit a form with JavaScript by clicking a link?
- How can I make my footer center to the bottom of the page?
- “AutoComplete=Off” not working on Google Chrome Browser
- Why would max-width not work on this?
- Making text background transparent but not text itself
- How to make my website fit any screen size?
- Display:inline not working
- What is wrong in chrome “net : Failed to load resource: net::ERR_SPDY_PROTOCOL_ERROR”?
- Bootstrap 3 Glyphicons CDN
- top align in html table?
- Warning: session_start(): Cannot send session cookie – headers already sent by (output started at [duplicate]
- single line comment in HTML
- How can I access http://localhost/wordpress/wp-admin/install.php?
- Why would a GET variable one one page of a site cause a 404 error when a GET variable works on another page of a site?
- How can I make my custom shortcode work in a Custom HTML Widget?
- Where should I install a PHP library into WordPress so that code in a webpage can activate it?
- Mail will not send in HTML
- Custom title widget / HTML encoding
- Add HTML Snippet only on specific pages
- Beautify WordPress HTML output without any plugins
- Minify HTML, CSS, JS with PHPWee?
- Add custom html to nav_menu
- Error shown for Trying to get property ‘roles’ of non-object in WordPress After Content for User Roles
- Prevent WordPress from messing my HTML
- How to Create Columns with WordPress and CPTUI display page ?
- Anchor removed from DIV after Quick Edit is used
- Input data from email form not going to JSON file
- Different post styles depending on category
- Most valid way for the URL html structure
- inside in editor
- Hide HTML element (by class or ID) with PHP
- Strange iframes added in wordpress 4.1 localhost
- HTML tables in content areas
- Why does hitting enter in Visual Editor add instead of ?
- Any idea how to get something like this to work? [closed]
- Echoing a variable comes out with lots of white space
- Illegal string offset error in wordpress theme options textarea
- Initial offset of number of posts in home page on the posts page
- WP List Pages – Add Title Attributes to Anchors
- WordPressUser Submission Form
- Time Delay a URL Redirect for Specific Page
- Cascading dropdown select search based on Parent Page & Child Page
- WordPress cascading dropdown selection search based on Parent Page & Child Page
- Adding HTML Code to Replace Text in PHP
- I can’t go to the page archive-{post_type}.php
- Get html from custom route api
- Use Search Term in html link and redirect
- Get and Update Most Meta Value as an array in HTML form
- How to center all text body in single.php at once?
- Collapsible menu on post sidebar only expands and does not collapse
- Random newlines inserted when pasting a chunk of HTML code
- How can I get my pagination loop to display the correct number of total pages?
- AMP version of e-commerce without plugin
- Bootstrap Carousel Indicators Won’t Cycle On Custom WordPress Theme
- Show post/page into div using function
- PayPall Button Data Issue
- wordpress, Category ID
- Include Information Text within Registration Page
- Pass the updated value of aid from form using ajax
- Arrange Category post manually when displayed
- Why wordpress can’t display the bash command properly?
- Render HTML with wp_send_json
- Have an html site but want to add an existing WordPress site to the back end.