Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.