0

If I want to put two to three parameters to the isset $_GET. Do I do it like how it is done in isset $_POST like this?

if (isset($_POST['pid'], $_POST['qty']))

So it will turn out something like this?

if (isset($_GET['pid'], $_GET['qty']))

Would this work if I will pass the $_GET and the $_POST will catch it?

1
  • Yes. It will catch. Make sure you have it in the proper order. Commented Jul 28, 2014 at 17:29

2 Answers 2

1

Yes you can use $_GET in isset

No, it will not automatically check $_POST, try

if (isset($_GET['pid'], $_GET['qty'], $_POST['pid'], $_POST['qty']))
Sign up to request clarification or add additional context in comments.

Comments

0

You will not need $_POST if all of your variables are in the $_GET array. You can check by doing this -

print_r($_GET);

Then you could check it with -

if (isset($_GET['pid'], $_GET['qty']))...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.