473,910 Members | 6,771 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

!isset

Hello,

does anybody know what the use of the exclamation mark in "!isset" is?
It seems that the script below is only willing to work properly if used
without "!".

extract($_SESSI ON);
if(!isset($pass word))
die ("Access denied");

Thanks!

Nov 8 '06 #1
2 1738
"shadowshif ter" <ol***********@ googlemail.comw rote in message
news:11******** **************@ i42g2000cwa.goo glegroups.com.. .
Hello,

does anybody know what the use of the exclamation mark in "!isset" is?
It is one of the basic operators, it performs a boolean NOT operation to
given value. Ie. if the value is FALSE, the NOT operator will make it TRUE,
and vice cersa, TRUE will become FALSE
It seems that the script below is only willing to work properly if used
without "!".
You are completely changing the functionality of the script to something it
was never intended.
extract($_SESSI ON);
if(!isset($pass word))
die ("Access denied");
This horrible piece of script registers all session variables as variables,
then checks weather the session variable called 'password' exists,
assumingly it is only present once the user has logged in. If it does not
exists, the script stops giving the error message 'access denied'. Once you
remove the exlamation mark, you are no longer checking weather the user is
logged in or not - in fact you are throwing out anyone who is. If this is
what you want, then you can remove the entire section of code if it is all
the same to you. Not that it was really secure in the first place...

--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
sp**@outolempi. net | rot13(xv***@bhg byrzcv.arg)
Nov 8 '06 #2
Thank you for your answer. The problem occurred in an internal
information system, accessible by only a few users. There is another
virtual host running, which needed the php.ini's session parameters
adapted. Since then the first authentication of the information system
is indeed able to authenticate the user/password and to redirect into
the "odd" script which comes up with the "access denied" message
lately.

Anyway, the only protected function is an index-update, so I won't
spend much more time on the matter.

"shadowshif ter" <ol***********@ googlemail.comw rote in message
news:11******** **************@ i42g2000cwa.goo glegroups.com.. .
Hello,

does anybody know what the use of the exclamation mark in "!isset" is?

It is one of the basic operators, it performs a boolean NOT operation to
given value. Ie. if the value is FALSE, the NOT operator will make it TRUE,
and vice cersa, TRUE will become FALSE
It seems that the script below is only willing to work properly if used
without "!".

You are completely changing the functionality of the script to something it
was never intended.
extract($_SESSI ON);
if(!isset($pass word))
die ("Access denied");

This horrible piece of script registers all session variables as variables,
then checks weather the session variable called 'password' exists,
assumingly it is only present once the user has logged in. If it does not
exists, the script stops giving the error message 'access denied'. Once you
remove the exlamation mark, you are no longer checking weather the user is
logged in or not - in fact you are throwing out anyone who is. If this is
what you want, then you can remove the entire section of code if it is all
the same to you. Not that it was really secure in the first place...

--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
sp**@outolempi. net | rot13(xv***@bhg byrzcv.arg)
Nov 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3440
by: christian9997 | last post by:
Hi I don't seem to understand the way isset works. Here is some Javascript code that makes a call using PHP: // USER CAME BACK TO CHANGE LANGUAGE if (<?echo isset($_REQUEST)?>) { alert("WORKS1"); desiredLanguage = "<?echo $_REQUEST?>";
2
6864
by: Pedro Fonseca | last post by:
Greetings everyone! I'm porting everything to PHP5. I have session variables in all of my web application. Until PHP5 I was using session variables like: if ($_SESSION == 'Bar') { $value = 5; } $_SESSION is of course set on some other script. But this now
9
9762
by: wouter | last post by:
hey hi..... I wanna make a switch wich does this: if pagid is set do A, if catid is set do B, if projectid is set do C, else do D. So i was thinking something like this:
2
37204
by: sathyashrayan | last post by:
Dear group, My question may be novice. I have seen codes where the isset() is used to test weather a user's session ($_SESSION) is set before entering a page. A kind of direct access to a page is not possible. But I tested with the "input type="button" and the clicking of the event is not happened. Can any one tell me why. The code: <html> <body>
2
2586
by: yawnmoth | last post by:
<?php $var = 'test'; echo isset($var) ? 'true' : 'false'; echo '<br>'; echo isset($var) ? 'true' : 'false'; ?> Why does that result in this output?:
8
2472
by: Giovanni R. | last post by:
Take a look at this code (you can execute it): error_reporting(E_ALL); function byVal( $v) {} function byRef(&$v) {} print '<pre>'; byVal ($first); // gives a notice
9
4499
by: arundelo | last post by:
Is there a way to tell whether accessing a variable will result in an "Undefined variable" E_NOTICE? isset() almost does this, but it also returns false if a variable is set to null: $SetNonNull = 0; $SetNull = null; var_dump(isset($SetNonNull)); // bool(true) $Junk = $SetNonNull; // No error, as predicted by isset(). var_dump(isset($NotSet)); // bool(false)
8
2397
by: Simon Dean | last post by:
Im taking Im doing something stupid here? I thought it was clever... just learned a little more about isset. $a = (isset($_GET)) ? $_GET : (isset($_POST)) ? $_POST : ""; I guess you can see what try each successive one in turn as we can alternate between the two. But it doesn't seem to be working.
10
2388
by: major | last post by:
The following code processes a blank field as though it has some value and proceeds as though it was set to some value. Apparently isset() is not working, because it thinks that a blank text field is set to something. Please let me know how to use isset() correctly. Thanks ahead.
0
226
by: Michael Fesser | last post by:
..oO(Daniel Molina Wegener) They have side effects or don't work properly. If the variable or element you want to check doesn't exist, then * the first and fourth will create it and set it to NULL * the second and third will throw an E_NOTICE error Micha
0
10037
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10921
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9727
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7250
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5939
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6142
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4337
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3360
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.