Categories
PHP

How to load grouped mysql data to table in php

I’m trying to build something as chained / bundle products and use these as variations. Here’s my query for loading the products: $related_query = database::query( “select p.*, pi.name from “. DB_TABLE_PRODUCTS .” p left join “. DB_TABLE_PRODUCTS_INFO .” pi on (pi.product_id = p.id and pi.language_code = ‘”. language::$selected[‘code’] .”‘) where p.main_product = “. $product_id .” […]

Categories
PHP

Add a User Email to a JS file as JSON string

I’m trying to integrate the intercom messenger on my WordPress multisite network using a custom plugin. I can’t use the official plugin because I want it to only load the script for Admin/Editor users and also have it load on the admin pages. (This is so site admins can access our support team that assists […]

Categories
PHP

Php mail send not working in localhost

I have set my settings in php.ini and sendmail.ini. Still, this script doesnt work. I havent tried it yet on the real server, where I have my website. Can anyone please tell me why this doesnt work? My code: <?php if(isset($_POST[‘submit’])){ $name = $_POST[‘name’]; $email = $_POST[’email’]; $subject = $_POST[‘subject’]; $message = $_POST[‘message’] . “\n\n\n\n\n” […]

Categories
PHP

Nginx Reverse Proxy Rewriting HTTP Response Codes

Full disclosure: I asked this on Server Fault and let it sit for a week without any answers and low views. I’m moving it here as I feel it might be more programming related based on the reception on Server Fault. I’ve flagged the original question on Server Fault for deletion. I have a PHP […]

Categories
PHP

Vuejs Loggin inactivated error on same page

So Im trying to do a login in Vuejs and it woks the only problem is I have a field in my database called activated. It is set to ‘0’ if they are not activated and ‘1’ if they have been activated. I’m using the session to log them in if their password is found […]

Categories
PHP

attach method for multiple record insertion in pivot table Laravel 5.5?

I want to insert multiple records in pivot table with just one query rather than using for loop and inserting one record at a time. Consider my pivot table has columns role_id, user_id, active. user_id and active are arrays and active only consists of value 0 or 1 I tried $role->users()->attach($users->pluck(‘id’)->toArray(), [‘active’ => $request->active]); but […]

Categories
PHP

Anyway to put this in a function so repetitive code isn’t used

This is my code for a project I am working on, is there anyway to shorten this code or even put it in a function so it is not this much repetitive code. I’m learning programming, and I was unable to find a solution to fix it. Is it a while loop or something I […]

Categories
PHP

Conflicts with Yum install php-mysql on Centos7

While trying to install php-mysql on a Centos 7 box… a conflict error occurs… I am not an expert CentOs Linux user. Any help is much appreciated with this issue. [root@bccweb01 ~]# yum -y install php-mysql Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirror.atlanticmetro.net * epel: epel.mirror.constant.com * extras: mirrors.mit.edu […]

Categories
PHP

php – How to get Related Searches suggestions on web page via Bing

I need to get Related Searches section of Bing search results to display on my website. Such as I need to to get a result of ‘avengers infinity war’. Related Searches provide on the right: avengers infinity war cast avengers infinity war official trailer avengers infinity war new trailer cast of avengers 3 new avengers […]

Categories
PHP

using $_POST with phpmyadmin

im trying to make an html form to simply post 4 variables into phpmyadmin via localhost. Ive been stuck for 4 days and have tried multiple codes, could anyone help me out? /var/www/html/update.php <?php main(); function main() { $dbname = “example”; $dbhost = “127.0.0.1”; $dbuser = “****”; $dbpass = “****”; $link = connectToSQL($dbhost , $dbuser […]