PHP: get full URL of current page with GET params or without

The following string variable’s value will get the full URL of the current page, including GET arguments/params, if present.

To get the full URL of current page but WITHOUT the GET args/params, do this instead:

The strtok function will return only the part of the URL string up to the character before question […]

Read More

PHP: avoid backslash on json_encode

Hey! 🙂 If you are encoding your Arrays to JSON in PHP using json_encode() and the function adds backslash before your slashes, I’m gonna show you a quick fix. This is my original code:

And the result is: {“success”:true,”message”:”Please enter email\/phone number.”} See the added backslash before the slash? Ugly, right? To avoid that, […]

Read More

Laravel 5: How to change Auth URL from “/auth/login” to just “login”:

Just sharing a link telling us how to remove the “auth” in the URL for Laravel’s pre-made login system. You need to modify App\Http\Middleware\Authenticate::handle() method and change auth/login to /login. Then you need to add $loginPath property to your \App\Http\Controllers\Auth\AuthController class. Source: How to change default redirect URL of Laravel 5 Auth filter?

Read More

OpenCart: Override Invoice ID

Edit: Seems like there’s something missing in the code I inserted. I only found out after further system testing. Will update this post when I feel like fixing it. :p I’m taking an E-Commerce class (it’s my last school term!) and my group’s project in an online store that uses OpenCart, an open-source shopping cart […]

Read More