Solved

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

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

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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
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.

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now