PHP Unset Session Variable

You can unset session variable using: session_unset – Frees all session variables (It is equal to using: $_SESSION = array(); for older deprecated code) unset($_SESSION[‘Products’]); – Unset only Products index in session variable. (Remember: You have to use like a function, not as you used) session_destroy — Destroys all data registered to a session To know the difference between using session_unset and session_destroy, … Read more

Parsing domain from a URL

Check out parse_url(): parse_url doesn’t handle really badly mangled urls very well, but is fine if you generally expect decent urls.

Only variable references should be returned by reference – Codeigniter

Edit filename: core/Common.php, line number: 257 Before After Update Added by NikiC In PHP assignment expressions always return the assigned value. So $_config[0] =& $config returns $config – but not the variable itself, but a copy of its value. And returning a reference to a temporary value wouldn’t be particularly useful (changing it wouldn’t do … Read more

File attachment with PHPMailer

When you call This creates a file in the uploads/ directory with the name of the file as it was named on the uploader’s computer. Then you used sample code to add the attachment to phpMailer so you’re basically attempting to attach non-existent files. These two lines: should be changed to: Also note, it isn’t necessary to … Read more

No Application Encryption Key Has Been Specified

From Encryption – Laravel – The PHP Framework For Web Artisans: “Before using Laravel’s encrypter, you must set a key option in your config/app.php configuration file. You should use the php artisan key:generate command to generate this key” I found that using this complex internet query in google.com: “laravel add encrption key” (Yes, it worked even with the … Read more

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