Solved

How to code if not (isset($_POST['xxx'])

Posted on 2014-03-21
2
262 Views
Last Modified: 2014-03-23
Hi,

I want to validate that two check boxes were unchecked.

How would I code:

if
      not    (isset($_POST['one']) && not   (isset($_POST['two'])

location redirect>>>>try again

Not s and ands , I'm thinking could be a problem causes problems

Isaac
0
Comment
Question by:TechIsaac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39946867
This is basically it.  A '!' before the function means 'not'.
if ((!isset($_POST["one"])) && (!isset($_POST["two"]))) header('Location: oldpage.php');

Open in new window

0
 
LVL 4

Expert Comment

by:MarcusSjogren
ID: 39948106
You can also use Empty($_POST["one"]), don't remember the difference by head but check php.net
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sum28 challenge 31 117
method argument as final 1 116
copyEvens challenge 6 127
Interview question Javascript, database 12 112
Navigation is an important part of web design from a usability perspective. But it is often a pain when it comes to a developer’s perspective. By navigation, it often means menuing. This is less theory and more practical of how to get a specific gro…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question