Questions tagged [php]

PHP is a widely used, high-level, dynamic, object-oriented and interpreted scripting language primarily designed for server-side web development.

0
votes
0answers
5 views

Get data from two tables

I have a query regarding join . Basically there are two tables product and product_boost . the table product_boost has the product_id as foreign key which is also in product table . I want to get the ...
0
votes
0answers
17 views

How to get reviews from Google Business using CURL PHP

I'm trying to get reviews in Google Business. The goal is to get access via curl and then get value from pane.rating.moreReviews label jsaction. How I can fix code below to get curl? function curl($...
0
votes
0answers
9 views

“Site cannot be reached” Socket.IO

I have been trying to connect 54.255.140.142:3000 using Socket.IO. I tried to open port using iptables -A INPUT -p tcp --dport 3000 -j ACCEPT command. It's giving error as "Site cannot be reached"
0
votes
0answers
6 views

GNU Parallel as job queue with named pipes

I followed the sample code to create a gnu parallel job queue as below // create a job queue file touch jobqueue //start the job queue tail -f jobqueue | parallel -u php worker.php // in another ...
0
votes
1answer
17 views

Laravel Controller -> API class

I'm struggling with how to do this correctly following best practices. It might be difficult to explain but i'll try my best here. I have an external API I need to make very many different calls to. ...
-1
votes
0answers
23 views

i have problem select date and time from sqlserver

i have a problem when query from sql server to php i need select between to date but i show in my page(php) blank page this code for php <?php $str= $_POST["start"]; $endd= $...
0
votes
0answers
11 views

Calling static function as non-static method?

Code beforehand class A{ static public function b() { } public function c(){ $this->b(); } } $d = new A(); $d->c(); $d->b(); PHP allows to call static functions as ...
0
votes
0answers
14 views

I can run my project in xampp(localhost) but i cannot run when am trying run in another computer even after configuring

<?php session_start(); define("HOST","localhost"); define("USER","root"); define("PASS",""); define("DB","project_inv"); define("DOMAIN","http://localhost/ inv_project/public_html/dont"); ?&...
1
vote
1answer
14 views

can't save data, when create new data by same category

Model error : "Array to string conversion (SQL: update spent_times set updated_at = 2018-10-23 09:16:43, spent_time = 16, percentage = 70, task_category = testing where id = 1) ◀" public ...
1
vote
1answer
14 views

Wordpress Query - Update Username Where Email Equals

We have like 350 users in our wordpress environment. We'd need to update all these usernames with a Telegram username for some reason. Is there a sort of query we can write in SQL so that we can ...
0
votes
0answers
4 views

Craft CMS module composer dependancy

After some research surrounding this I can't seem to fix this issue. So for a project I made a simple module with some variables that simply has to make an OAuth1 call and return some data. The ...
0
votes
1answer
19 views

Laravel: relations on same table

In my application I have a users table, in this table there is a field called managedByUsername which is the username of that particular user's manager. To get your employees specifically you could ...
0
votes
0answers
6 views

Access form element in phpword

I have a simple word document with only a form input, and i want to access in read and write to the input element, However i dump the element but i found no where an occurence of my form input ? do ...
0
votes
0answers
13 views

Replacing HTML tags over multiple lines using preg_replace [duplicate]

I'm trying to use preg-replace to transform this: <p> <button> </button> </p> into just <button> </button> with this code: preg_replace('/<p><button&...
0
votes
0answers
7 views

How to disable searching on few columns but keep sorting enabled in GridView widget column in Yii2

I want to keep sorting enabled on all columns but disable filtering on few specif fields. For example, I want to disable filtering on first_name column but enable sorting on the same column. How can ...
1
vote
1answer
10 views

get specify word from string php codeigniter

I have an input for search , i search for "res" <input type="text" name="search"I/> i use Like method to get search results, $txt = $this -> input -> post("search"); $this -> db -&...
0
votes
0answers
7 views

GNU Parallel as job queue processor

I have a worker.php file as below <?php $data = $argv[1]; //then some time consuming $data processing and I run this as a poor man's job queue using gnu parallel while read LINE; do echo $LINE;...
-1
votes
0answers
15 views

$SERVER['QUERY_STRING'] empty

I am just writing custom MVC on Mac the issue is the output of this code is empty, i have configured apache root base url to my mvc .htaccess file was hidden in mac by default but i have used the ...
0
votes
0answers
11 views

Magento After adding the double quote in attribute option swatch images not change in front-end

In Magento 1.9.1, I have added a size attribute and add a option to that size attribute as Large 9.5" Tall x 7.5" Diameter & Small 2" Tall x 5.75" Diameter. After adding this option with double ...
0
votes
0answers
16 views

Display word endings depend on gender (Polish language issue), PHP

This problem might not occure in English, but does really hurt in Polish language. I guess that my question is mostly for Polish users since they might already have a decent solution. What I mean, is ...
1
vote
0answers
19 views

Getting dropdown value then inserting it to textbox inside a table, but doesn't change the second row

I'm trying to get the value of a dropdown then inserting it to my textboxes then after that it will save to database. The data is coming from the database. The problem is after I select data from the ...
0
votes
1answer
12 views

Composer codeIgniter “nothing to install or update” even add library into composer JSON

It's a long time i didn't use codeIgniter as my framework. I'm gonna install library using composer in codeIgniter, Library i want to install is hybridauth for social login with codeigniter. I have ...
1
vote
5answers
37 views

PHP echo php but replace any space

Hi I am echoing out a field name which is going to be part of a url. However the name itself has uppercase lettyers in it so I have made them all lower on the echo. There is however a space between ...
1
vote
1answer
19 views

How to change id to related content (id, subject) in table — Codeigniter

I'm new to CI, I want to ask if i have a table that contains id, subject, and gpa. I get the url that contains id_table from segment $id = $this->uri->segment(3); $subject = $this->...
0
votes
0answers
7 views

DYNAMIC rich responses in dialogflow

I am building a chatbot with dialogflow with php and json. I am lately struggling on the internet trying to figure out how to dynamically modify rich responses. As an example If user is intrested in a ...
0
votes
0answers
11 views

Simple_Dom Error: file_get_contents(): stream does not support seeking in Laravel

I'm getting a error as below. file_get_contents(): stream does not support seeking I installed simple_dom by a composer: composer require sunra/php-simple-html-dom-parser and used this too: ...
3
votes
3answers
33 views

Sort/group array by key

TL;DR Sort/group array by key without adding another level to the array (data parsed by jQuery plugin)? Details I am building an array to return to some <select> DOM element. It takes in CC (...
0
votes
1answer
26 views

Extending DB facade Laravel

I would like to convert a timestamp and have some other values related to it. My question is how I can introduce my own method like DB::raw() that appends everything to the current select values. So, ...
0
votes
0answers
16 views

Save big array in Laravel cache

I am trying to save arrays in Laravel cache. It works perfectly for small arrays, but has trouble for big arrays (my machine stops working). For example array with 5000 rows and 7 column. Estimated ...
0
votes
0answers
12 views

Return a View with a Variable in laravel using vsmoraes/laravel-pdf package

I'm in need of printing data from the database using the vsmoraes/laravel-pdf package but can't be able to pass on the data into a view. This is my function in the controller public function print($...
0
votes
0answers
18 views

How to transfer server's session data to another one? [duplicate]

I would like to know what are the options or what is the best way to transfer session data in another server (I am using PHP and Apache2). For example, I have 2 different servers and if one goes down ...
1
vote
2answers
41 views

Regex Preg Replace HTML

Please consider the following paragraph... {{if|service_name=Service}} Hello this is the Service text {{endif}} This is the format that I allow my users to place custom conditional variables ...
0
votes
0answers
13 views

Authentication user provider [passport] is not defined with laravel passport

I have an api in laravel and im using passport to authenticate. On my config/auth.php file i have changed this so the api guard using passport and refers to my user provider 'guards' => [ '...
0
votes
0answers
28 views

Using a namespace inside a variable: PHP Fatal error: Uncaught Error: Class name must be a valid object or a string

I keep getting the error: [23-Oct-2018 11:14:11] PHP Fatal error: Uncaught Error: Class name must be a valid object or a string in /www/app/core/App.php:34 On this line: $this->controller ...
0
votes
2answers
42 views

How to split up the value as an array

How to split up the value to an array. I have the whmcs api data it looks like 1,2,3,4,5. I need to split up the value to an array value suggest any solution My api data Array ( [result] => ...
0
votes
0answers
6 views

Woocommerce and WSO2 Intregration Authentication

We are using a Woocommerce Webhook to send a JSON request to a client who is using WSO2, but if they switch on authentication I get 401 error. I have tried setting the consumer key and secret with ...
0
votes
1answer
31 views

Mysql count vs select performance in wordpress

I have a very large database (~10 million rows) and I want to list these things as fast as possible in a table. I have few options : I can limit the rows from Mysql - Not Preferred as I want to count ...
0
votes
4answers
35 views

Mysql Data Selection

I have this table and I would like to select some of the data into a form, but I my query is not working. can anyone figure out what is wrong with my query? Above the table, I only wanted to show ...
0
votes
0answers
5 views

MAMP can't load php_memcache.dll

I am using PHP 7.2.1 with MAMP PRO 4 on Windows 10. When an exec() function in php handles large files (>100M), my code stops and I keep getting an internal server error (500). (Even though the exec()...
-1
votes
0answers
21 views

Using POST to get select option value from HTML table

I have a drop-down list, but how do I get it to filter the list in the table when I select a value? Can anyone help me fix my code below? $query_param ="SELECT USERNAME FROM LOGIN"; $...
-7
votes
0answers
33 views
-4
votes
0answers
14 views

Creating widgets for specific posts [on hold]

So I'm building a theme that has articles(magazine), so the posts are linked in the menu essentially as pages. Now this is all fine, I managed via categories to have it so if you click on the parent ...
0
votes
1answer
23 views

Edit user laravel using Vue

I have a modal component and a users component which has all the users in an HTML table. I decided to use modal to edit the user. I've added the modal and linked a button to each user in the v-for ...
-2
votes
0answers
26 views

how to replace dropdown list by date picker for filter this? [on hold]

if ( !empty($logs) ) { echo '<div class="form-group">'; echo '<select class="form-control" onchange="window.location = \''.$url.'?log_date=\' + this.options[this.selectedIndex].value"&...
-3
votes
0answers
14 views

Products sub categories in WordPress woo commerce are repeating [on hold]

when we click on the main category of any products their sub categories are repeating. Here is the link https://www.pktrolley.com/product-category/baby-care/ any solution?
-1
votes
0answers
12 views

How can I revalidate multi dimension input field in Bootstrap validator [on hold]

I am trying to revalidate a multidimensional input field (item_quantity_drop[0][]) on change of dropdown. Below is the method I am using to validate: $('#form').bootstrapValidator('revalidateField', '...
-1
votes
0answers
31 views

How can I edit my published news using MYSQL quries

Currently this is what I use to publish my news : <?php if(isset($_POST['submit'])) { $db = getDB(); $title = (!isset($_POST["title"])) ? 'Empty' : $_POST["title"]; $...
-1
votes
0answers
18 views

Get text of excel file (.xls) and post it into a .csv

I installed PHPSpreadSheet to get values of a Excel file and convert them into a csv. What I tried to do is, create a .csv file and then getting the text of the Excel. That was my try: $fp = fopen('...
0
votes
0answers
18 views

On language switch parse template in PHP

I have the following problem. I have a Form and use Sessions to safe the active step when the User will reload the page. In my Wordpress Template I use WPML to switch between language. Now I will ...
0
votes
0answers
11 views

Calling 2 behat scenarios with MinkExtension & RestContext return 404 for 2nd one

I have noticed unexpected behavior for testing features with Behat and MinkExtension. When I am calling the 1st scenario, result is as expected, but when I call any 2nd request, it returns 404 ...