Solved

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

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
withoutTen challenge 14 132
splitOdd10 challenge 5 116
allswap challenge 6 116
Bartender Integration Builder 3 44
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…
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

830 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