PHP: fopen() Permission denied

I am confused with this code: test.php: when I execute it, I get an error: test.txt: where is the problem? Thanks a lot!I have found the problem,I use FC13,because of the protect of SELinux,some action is denied.So, I just need to get rid of the protect.

PHP Error : Fatal error: Constant expression contains invalid operations

From the official Php documentation : Like any other PHP static variable, static properties may only be initialized using a literal or constant before PHP 5.6; expressions are not allowed. In PHP 5.6 and later, the same rules apply as const expressions: some limited expressions are possible, provided they can be evaluated at compile time. … Read more

what is $_SERVER[‘QUERY_STRING’] ? how it works?

Explode : Returns an array of strings, each of which is a substring of string formed by splitting it on boundaries formed by the string delimiter. array explode ( string $delimiter , string $string [, int $limit ] ) Run this Code to Understand : The above example will output: And, In Your Case, Your … Read more

How to use $_SERVER[‘HTTP_REFERER’] correctly in php?

I wouldn’t recommend using HTTP_REFERER: It’s fairly simple to manipulable in browser. Some users might have security settings in their browser to not send this header at all. It’s not accessible over HTTPS. Some proxies strip this header from the request Added – See answer to this quesion As Charlotte Dunois stated in the comment, … Read more

PHP – syntax error, unexpected T_CONSTANT_ENCAPSED_STRING

When you’re working with strings in PHP you’ll need to pay special attention to the formation, using ” or ‘ Both of these are valid, the following is not: You must also note that ‘ inside of a literal started with ” will not end the string, and vice versa. So when you have a … Read more

PHP array delete by value (not key)

Using array_search() and unset, try the following: array_search() returns the key of the element it finds, which can be used to remove that element from the original array using unset(). It will return FALSE on failure, however it can return a false-y value on success (your key may be 0 for example), which is why … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)