Hello, people I am not a programmer. I am in situation where I need to understand what this code is about: die("Hacking attempt"); can anybody explain in plain words ? Thank you
This code exits the current script and shows just the text. You can find more about the die() language construct here. www.php.net/die
Thanks!!! sounds like human talk Look. In some of site's PHP files I see this: <?php if ( !defined('********') ) { die("Hacking attempt"); } (don't pay attention to stars) does it mean that the site INVOLVED IN HACKING anyway?..
That snippet of the code you posted does not indicate it is. It seems to me the purpose is to tell the person using the script ( or your server logs ) that someone is attempting to hack *your* script. That code does not try to hack anything else, as said earlier the command die makes the program stop executing immediately and display the message passed to it.
The script is saying that if something is not defined, display the message "hacking attempt". My guess is it is there to warn you that your site is being hacked, OR that you have forgotten to define a variable etc. in some config file somewhere.
Right, it's just displaying Hacking attempt when the script runs unsuccessfully. Most likely means nothing, and just wanted to be creative. the if !defined means if its not defined, then this will happen
Respect and reputation to all of you, guys and thanks a lot. +++ to clarify why am I asking this question: I was trying to hire a programmer for some work, and he refused that work, because "THE SITE IS INVOLVING IN HACKING". Now I know that all he told me was wrong. I believe the reason was something else. Thanks again!
LOL. Even if it wasn't another reason, if a 'programmer' tells you that then you don't want to work with him anyway
that was the funniest thing i saw today ) he must be an expert on PHP and hacking that part of the script is used on some php scripts (like phpbb2) to not allow direct access to some files (mainly php files that store classes or functions used by the script). So, if someone try to access that files directly, it will get a msg "Hacking attempt" and script will stop
that bit of code is very common to prevent loading of modules with out going though the loader script.
TwistMyArm petronel ndreamer it sounds funny to me now, when I know what it is. But I was scared to... death when I got the email from a "programmer": This is to inform you that, We are cancelling the contract for rectifying the links due to reason mentioned below, Our policy don't permit us to do this work. You never mentioned that HACKING is involved in this. We are cancelling that contract and we are no where involved in this project. We don't prompt hacking at anycost BTW, I emailed him the link to this thread so he can learn something about programming Thank you, guys! PS: forgot to mention that the guy is a DP member
rofl! I doubt he's a competent programmer at all! I've only read into the basics of a PHP book, and I already know what die() does. The rest of the syntax is easy to follow from other languages. die() is like, page 10 of a php book, on what to do when your script overloads your server.
lol, some 'programmer' obviously never bothered to read the script he was working on Hey, at least the guy has ethics anyway!!
"Ethical"? I disagree... he passes himself as a programmer but doesn't even understand the basics of the language. No doubt he was happy to take the money under the guise of a programmer. I wouldn't call him ethical at all! I would change that line to 'at least the guy was covering his arse!'. The funny thing is that with what his abilities appear to be, his code could only be called 'hacky' in the first place!
This statement by itself doesn't tell us much. Maybe there's some code that causes this statement to be executed? Maybe there's some hacking detection code?