T
T
TopClans2015-12-18 11:43:38
PHP
TopClans, 2015-12-18 11:43:38

How to execute a PHP script if the form loads javascript?

There is a form:

<form action="" method="POST" onsubmit="function-name(this);">

After the form is javascript, which forces the data to go to another page, where it is processed by another script.
I also need to process the data from this form with a PHP script that is installed either in another file or on the same page.
How can I make the PHP code process the form first, and then execute the javascript?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
ssrdop, 2015-12-18
@ssrdop

Use ajax to process php script.

M
Michael, 2015-12-18
@scherbuk

remove onsubmit and execute js according to the cookie condition
in the php handler where the form is being processed, create a cookie

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question