Solved

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

Posted on 2014-03-21
2
258 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
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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
zeroMAx challenge 20 103
seriesUp challenge 7 155
Modbus - whats the maximum I can store in one register? 4 80
countHi2 challenge 7 55
There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

809 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