Comment on Tutorial - isset() function in PHP By Emiley J.



Comment Added by : Bijan

Comment Added at : 2012-09-21 20:49:41

Comment on Tutorial : isset() function in PHP By Emiley J.
The !isset() is basically checking if the string is NOT true.
Take the first example:
if (isset($first_name)) {

print '$first_name is set';

}
This checks if the var $first_name has been declared. In plain English, if user hasn't filled out the form "First Name" yet then it will return false when he submit it.
Now:
if (!isset($first_name)) {

//So the $first_name is not set obviously, not you want to notify the user that he must
//have it filled

print 'Please fill out your First Name';

}
For this one you are checking if the $first_name has NOT been declared. The "!" means "NOT", this is listed in the operators http://www.w3schools.com/php/php_operators.asp
There are two or more ways to do this and it depends on what your are tying to achieve.
I am not a "PRO" at php just yet since I just stated but you'll know this but reading the link I gave.Also please if I said something wrong please correct me. ^_^


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Hi, these are the lines i added after i downloaded
View Tutorial          By: sandeep,p at 2012-11-22 10:17:07

2. Hi Ramlak, Can you please let me know to resolve t
View Tutorial          By: Braj at 2009-01-29 08:50:33

3. Good and very clear explanation...
View Tutorial          By: Pavana at 2010-01-05 23:35:30

4. Daniel Jonsson, you should be thankful to this art
View Tutorial          By: dole at 2011-11-12 06:44:42

5. i am getting following error

Error

View Tutorial          By: Pavan at 2009-11-26 21:31:22

6. you do the same as after
Private Sub Button

View Tutorial          By: John McCode at 2013-05-24 07:57:31

7. abstract class Explain the concept of abstract c
View Tutorial          By: rahul at 2012-02-23 08:30:47

8. Turning off hostname checking also turns off all s
View Tutorial          By: eric at 2014-01-30 18:09:05

9. Can u send total code, i am in critical position n
View Tutorial          By: ram at 2011-05-16 07:07:10

10. copy of h.sheld
View Tutorial          By: vivek at 2011-08-31 13:12:36