Jump to content

if $_POST


dmccabe

Recommended Posts

so you have a page that handles posts from several different pages?

 

you can differentiate with either a hidden input element or with a GET variable. just use a standard name across all the forms (like 'source') and then you can use a switch statement on your form processing page

Link to comment
https://forums.phpfreaks.com/topic/110927-if-_post/#findComment-569066
Share on other sites

I have been using this code to check if the submit button on a form has been clicked.

 

if (isset($_POST['hoi'])) {

 

However the problems is the 'hoi' isnt always set, so can I do something like:

 

if (isset($_POST)) {

 

Instead just so it checks if something has been posted?

What is $_POST['hoi'] associated to in your form? You should give your submit button a name, then reference the submit buttons name in the $_POST array instead to check to see if the form has been submitted.

Link to comment
https://forums.phpfreaks.com/topic/110927-if-_post/#findComment-569402
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.