[SOLVED] Redirect Form call a PHP with POST method

Status
Not open for further replies.

linque

Member
Hi,
How can I create a Form with a redirect the call to a PHP with a Post Method.
I use the plug-in 'redirect' but I receive data only with Get Method.
Thank's in advance for the answers...
 
You can use the php form plugin to do nearly anything you want to do.

Gesendet von meinem SM-G930F mit Tapatalk
 
I don't see how to send data like the following code for example :

<form action="/url" method="POST">
<div>
<label for="say">Quelle salutation voulez-vous dire ?</label>
<input name="say" id="say" value="Salut">
</div>
<div>
<label for="to">A qui voulez-vous le dire ?</label>
<input name="to" id="to" value="Maman">
</div>
<div>
<button>Envoyer mes salutations</button>
</div>
</form>
 
@linque:

Fabrik forms are using method="post".
A form redirect plugin as mentioned in your initial post lets you only specify a different URL than the default list on form submission -- that's all. So, pretty sure that's not what you want.
If you want the form data to process it with your own custom PHP, you should indeed use a PHP form plugin -- as @troester already said.

The Wiki here might not be perfect, but the links given should be good reads for you and this specific use case.
 
Redirect and/or open new tab in php form plugin can be quite trickey. Can you be more specific what you want to do?

And again " <form action="/url" method="POST"> " is HTML
 
Thank's for your answers.
I found the solution.

Create a FORM adding a button
Add au Javascript 'OnClick'
Use for example the following script :

const form = document.createElement('form');
form.method = 'post';
form.action = '/test.php';
form.target = '_blank';
document.body.appendChild(form);

const formField = document.createElement('input');
formField.type = 'hidden';
formField.name = 'FieldID';
formField.value = $('___FieldToSend').value;
form.appendChild(formField);
form.submit();
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top