I am always getting an error that PDO driver not found. I tried restarting, installing PDO extensions directly. Note that this docker setup works on my Linux box last night. Only difference is I did it from scratch compared to on my Windows box I already has images. After getting the error initially I tried t…
Tag: php
Adminlte in Laravel sidebar based on permission
I have multiple users with multiple permission (admin and user). example: admin is able to see sidebar a,b,c but user can only see sidebar d,e,f. Can you load the menu at adminlte.php based on the …
How to check that fifth and sixth characters are a specific two-digit number?
I would like to validate phone numbers. The only valid phone numbers start like this: +36 20 | +36 30 | +36 31 | +36 70 My code looks like this, but now you can enter +36 21 or +36 71 which I would like to avoid. How can I check for a two digit number? Like 70 or 30.
Dynamic MySQL Query with PHP
I am looking for a way to make dynamic queries to my MySQL server. At the moment this is the code I use to update data on the server: As you can see, the SQL column names are the same as thedeskAttrkeys. I’m looking for a way to make this line a loop so, that I don’t need to change
Change WooCommerce variable product title based on variations
I’ve coded in a custom select box to a group of my products that changes the price based on the user’s selection. It works well, but now I need to change the product title too based on their selection. Basically if option 1 is chosen, the product name stays the same. But is option 2 is chosen, I n…
Impossible to access an attribute on a string variable
In my controller i just pass some users on my twig view. Here is my function : And this is my twig view where i want to display some information on a html table : And i got this error : Impossible to access an attribute (“name”) on a string variable (” “). for this line : Thanks for he…
Php file gets downloaded instead of executing on OSX with Nginx server
Hi I have followed https://www.sylvaindurand.org/setting-up-a-nginx-web-server-on-macos/ to install nginx and php. I am using OSX El-capitan, php-fpm and nginx versions are nginx 1.12.1 and php7 My server is working as I am able to open html file stored at document root in browser but when I try to open php f…
how to create regex to accept combination of alphabets, numbers and special characters but not single alphabet or number or special characters
I want to create regex which will accept combination of alphabets, special characters,numbers but not only alphabets or special characters or numbers For example : It should accept 1 Slice brown bread (wheat) 1 Tbsp 1/2 cup But it should not accept Slice brown bread 1 @#%&%&* This is what I have tried…
Using array_search for multi value search
$array_subjected_to_search =array( array( ‘name’ => ‘flash’, ‘type’ => ‘hero’ ), array( ‘name’ => ‘zoom’, ‘type’ => ‘villian’ ), …
LinkedIn API OAuth refresh token
I am using LinkedIn API to pull updates from there and display on the website. While using OAuth, I am storing the token in a file and then pull it from there again to prevent the login popup. However, I am not clear once my token expires how will it get refreshed. Following is how I am reading the token