Hi
My website if falling to bits around me and I cant see why!! All instances where I have
used the ! operator in the php code such as

if(!isset($_POST['anything'])){

Have stopped working and just return true which is causing nightmares with security ect. I have googled till im blue but cant seem to find any reason for it. Does anyone know what might be causing this. I have the problem both on my live site and the same when I run my local copy through xampp(localhost)

If I were in your position, I'd probably start with a very short piece of code that demonstrates the problem and prove that it works on a local test system. Move it to your server and try it again. If it doesn't work there, I would immediately go to your web host and get their help. Maybe they installed a new version of PHP or did something in the config that is creating a problem. Obviously, if your demo code works on your server, then you have some sort of problem that is specific to the web site.

Until it is resolved, I'd probably take the web site offline rather than take the risk.

As if day has turned to night everything is back to normal not touched anything moved anything or changed anything?????? Am absolutely stumped as to what happened there am dropping an email to my host to see if they were doing anything but cant see what would make it happen.

Could this of happened through some sort of attack? Is there even away to disable the !operator???

N

Just to make sure:

if(!isset($_POST['anything'])){

will return TRUE if $_POST is NOT set right?

Are you sure you aren't confusing it somehow? It would be very improbable that something so unique would happen both on your server, and on your localhost at the same time.

If it was a coincidence, then it probably is not the ! operation, but a problem with $_POST or something similar.

When dealing with bugs like this, the last thing you want to blame is the internals of the programming language, as those are hardly ever the cause of the error.

I agree but it has been working fine since I went live with it and hadn't done any revisions on the site just dont want it happening again

Cheers N

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.