How can I execute a PHP function in a form action?

后端 未结 7 1142
死守一世寂寞
死守一世寂寞 2020-12-25 11:29

I am trying to run a function from a PHP script in the form action.

My code:



        
7条回答
  •  心在旅途
    2020-12-25 12:17

    Is it really a function call on the action attribute? or it should be on the onSUbmit attribute, because by convention action attribute needs a page/URL.

    I think you should use AJAX with that,

    There are plenty PHP AJAX Frameworks to choose from

    http://www.phplivex.com/example/submitting-html-forms-with-ajax

    http://www.xajax-project.org/en/docs-tutorials/learn-xajax-in-10-minutes/

    ETC.

    Or the classic way

    http://www.w3schools.com/php/php_ajax_php.asp

    I hope these links help

提交回复
热议问题