Questions tagged [php]

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

0
votes
0answers
4 views

Why Linux creates temp files without extension when you upload file with PHP, and Windows makes with extension?

I'm using PHP 7.0 and 7.2 with both UBUNTU 18.0 TLS and Windows 10, I have a script that normally uploads files and process its content, the behavior I'm asking about is that on Ubuntu, the temp ...
0
votes
0answers
5 views

Replace preg_replace to preg_replace_callback() [duplicate]

I used PHP7, I need to replace two rows in a plugin with preg_replace to preg_replace_callback(). I feel it could be simple but I have no idea how to solve it. $source_content = preg_replace_callback(...
0
votes
0answers
9 views

PHP and MYSQL Data Insertion on Windows and Ubuntu

I'm migrating my full php project from windows to ubuntu 18.04.2 LTS. I'm using xampp for apache7 and mysql v.14 services in windows and Im running apache and mysql standalone services in ubuntu. The ...
-1
votes
0answers
10 views

How to add a virtual money system to website [on hold]

I want to add a payment system to my site. Other users can use Paypal to charge their credit on their profile. The money is given in the form of credits. How does it work?
0
votes
0answers
6 views

Firebase and PHP ADMIN_ONLY_OPERATION

I'm working with Codeigniter and FireBase and have a problem when trying to create a new user: { "error": { "code": 400, "message": "ADMIN_ONLY_OPERATION", "errors": [ { "message": "...
0
votes
0answers
6 views

oci_bind_array_by_name error after migrating to Oracle HTTPS Server (OHS)

My application was working fine with the below architecture. PHP,CodeIgnitor, Apache ,Oracle-database. As per organization standards I have migrated from Apache to Oracle HTTP server (OHS). In my ...
0
votes
0answers
21 views

PHP get objects based on their array position and a limit

I have an array of objects (generated by TYPO3) which is coming from the variable $times and looks like this: TYPO3\CMS\Extbase\Persistence\Generic\QueryResultprototypeobject (8 items) 0 => ...
0
votes
0answers
12 views

How make redirection with web service?

I have a web-service which send JSON object as response to log my user. But if I take the URL of the service and I put it on my navigator I see the json object, how I can send the json througth a ...
-1
votes
1answer
25 views

Insert PHP function in Javascript

Can you please help me. How to add this PHP code: <?php echo short_title(' ', 3); ?> Here : <a target="_blank" href="https://www.amazon.com/gp/search?ie=UTF8&tag=abc=<<<Insert ...
0
votes
1answer
20 views

Illegal string offset even though I already decoded array in controller?

I get an array out of a form that could look like this example: array [ "absender" => "Maxim Ivan", "email" => "maximivan@example.com", "telefon" => "1234567890", "fax" => null, ...
0
votes
0answers
8 views

Multiple Array values (some value same) how to get only 2 values same

Multiple values ​​in a single array (some value similar) how to get One of them is to get the array that is similar values minimum 1 and maximum 2 times repeat for Example This array - $...
0
votes
0answers
3 views

Docusign: Sandbox works 100%, fails in production when adding a FORMULATAB

We have successfully implemented and tested the Docusign API service for a client. I've added a formula tab, which calculates the the value of 3 different fields. It works great and it works with the ...
-4
votes
0answers
16 views

php mysql query adds quotes in the end

I have set up a query as such: $query ='SELECT SGC.sys_id, TBL.semester, SGC.bonus, SGC.exam, SGC.ca FROM SubjectGradeComponent AS SGC, '; $query .='(SELECT `sys_id`, `semester` FROM ...
0
votes
0answers
9 views

How ckediter text convert in word file? it did not open can anyone help me?

i made a block in Laravel i use ckeditor in textarea and download that text file in word formate using Laravel but it not open and give error XML parse error i download word file $data= Templete:...
0
votes
0answers
16 views

Windows username fetch in PHP

i have this function below and works good but brings user of computer name <?php echo getenv("USERNAME"); ?> I want to bring name from windows like mazhar is windows user name which we usually ...
1
vote
6answers
40 views

How to return values from an associative array in a php class

I'm new to php and I'm only just starting to find my way, but I'm having trouble getting values out of a public associative array using a public function which incorporates a foreach loop. The php is ...
3
votes
0answers
14 views

Giving priority to prefix match in elasticsearch in php

Is there a way in elasticsearch to give more priority for the prefix match than to the string that contains that word? For ex.- priorities of words if I search for ram should be like this: Ram Reddy ...
0
votes
1answer
18 views

Tidying up a JSON-like string with PHP and str_replace

I am putting an inout field value into my database which is has the structure of the following string: [{\"value\":\"Product 1\"},{\"value\":\"Product 2\"},{\"value\":\"Product 3\"}] Now I want to ...
1
vote
0answers
17 views

how to compile a proto file to a single php file

I tried to compile a protobuf file in php by using protoc, but when I wrote more then one message in the 'pbfile', the protoc gave me so many php files. The 'pbfile' contents are: //test.proto begin ...
0
votes
0answers
27 views

How to group array value duplicate and customize the display of the results of the array in html table?

I have here a for loop, $limit is the number of year (this is based on the sql database result). In this case, the $limit is 3, the count of lid is 3 (1, 2, 3). Then used another query to get all the ...
1
vote
1answer
19 views

For specific products on WooCommerce orders with completed status, perform an action

IN WooCommerce, I would like to perform an action if at least one product from a list is bought and if the current order status for that product is completed. For instance I can only verify if the ...
0
votes
1answer
9 views

TCPDF font tool: How to generate font files using OTF font type

When running the tcpdf_addfont.php tool for generating font files used by tcpdf php .\tcpdf_addfont.php -i HansomFY-Light_S.otf I am getting the following error message: *** Output dir set to ...
1
vote
3answers
32 views

API working only in one condition - using laravel

I am creating API my controller code: public function isUserGroup(Request $request) { $id = $request->input('id'); $isGroup = $request->input('isGroup'); if($isGroup == false) {...
0
votes
0answers
10 views

how to make the slider display on desktop and mobile the same

I have a slider for the desktop with the image below this is according to need but why when it changes to the dektop version it becomes like this I use a swiper slider with JS like this //slider ...
-1
votes
0answers
24 views

Error inserting DateTime values on database

I searched for this online and some posts even here on stackoverflow talk about this but never resolve to my problem. I am having a problem inserting DateTime into database. The first problem is that ...
2
votes
1answer
8 views

Catching fwrite() / socket errors

I am creating a library which is making a socket connection: public function __construct(Options $options) { $this->responseBuffer = new Response(); $this->connection = ...
-1
votes
1answer
14 views

Web scraping table elements - Uncaught Error

I'm trying to scrape data from a website using Simple htm dom and PHP Website: http://portal.chmi.cz/aktualni-situace/aktualni-stav-pocasi/ceska-republika/stanice/profesionalni-stanice/tabulky/...
-1
votes
1answer
18 views

How can I fix CURL quotes strpos() problem?

Firstly, sorry my bad English. I'm taking text from a site with Curl. After that, I am searching in text some words with strpos(). But; when text coming with quotes, my function is not working. For ...
-2
votes
0answers
31 views

Should i be using a class for these user functions

I have read a couple of articles and i got to the conclusion that using a class for the user information is better than just storing it in an array. I can do that but the problem is i have some user ...
0
votes
1answer
23 views

RecyclerView not updating after input

Im saving data in MySql and want to add an update function to my saved notes. Im displaying the arraylist of notes in a recyclerview. When updating i have implemented a click function on my cardview ...
0
votes
0answers
4 views

How to edit left sidebar used on product in magento 1.9 and i am unable to find code

I have installed Magento 1.9 On the product page, there is left sidebar which consists of 3 topics: Recent posts Most Views Categories topic I want to edit these anchor tags but unable to find the ...
0
votes
0answers
7 views

How to write a custom layout builder block as a module in Drupal?

I'm new to Drupal (and PHP as well). I has been asked for investigate how to write a custom layout builder block as a module. My Drupal version: 8.7.1 (the latest version) My PHP version: 7.2.18 (...
1
vote
1answer
56 views

Generate 5 million unique codes

I am looking for an efficient way to generate 5 million unique codes with 7 characters (letters, numbers, special chars). Basically, my idea was to generate a table with a unique constraint. Then to ...
-2
votes
0answers
25 views

How to solve Array to string conversion in C:\… inside an array in PHP? [duplicate]

This is my array: $aArrayRand = array( "<tr><td>$aSettings[settingOne]</td></tr>", "<tr><td><input type ='text' name='txtAnswer[$aNumbers]'</td></...
0
votes
0answers
11 views

Wordpress - PHP Fatal error: Interface 'Requests_Hooker' not found?

i am not able to access my wordpress frontend. After uploading the 'understrap' theme my backend and frontend throw an http 500 exception. In order to debug the issue, i've set 'WP_DEBUG' to 'true' ...
0
votes
0answers
9 views

How to store cookies and send it in further requests using guzzle php

I am writting a helper functions in laravel that calls the api which works on cookie session basically to do anything i have to first call the login api which gives the session cookies ,that i need to ...
0
votes
1answer
29 views

Foreach loop if and else condition not working properly

I am stuck at this code, code properly working but in index.blade.php foreach loop not working properly. I am try to show if one user block multiple user then "Unblock" button show in only those user'...
0
votes
0answers
11 views

Is this correct usage of Builder pattern

I have a scenario like this: The system handles reservations from couple of different sources. All bookings come in the form of a json with differing formats for each source. Some JSON attributes are ...
1
vote
3answers
31 views

What alternative of code that work in PHP7 in PHP5

I have a PHP code which runs on PHP7 but not in PHP 5, which PHP version in my server, that is my code: Array ( [0] => stdClass Object ( [userId] => 15 [name] => name0 ...
-1
votes
0answers
13 views

User registration limit and registered user confirmation not working. What do i do? [duplicate]

I am trying to limit user registration in my database and also check if user already exists in the same script. Here is what i have below, I have tried to put the code in diff ways but nothing works. ...
1
vote
2answers
27 views

Get string between numbers using PHP

How can I adapt this function below to get string between numbers? Function: function getInbetweenStrings($start, $end, $str){ $matches = array(); $regex ="/$start([a-zA-Z0-9_]*)$end/"; ...
-1
votes
0answers
12 views

How to measure dynamically the amount of successful/unsuccessful rate for function with less amount of coding in PHP

I want to measure the tries/exceptions rate per job in queue with dynamic representation in charts. Do we have some out of the box solutions for that with ready-made API?
1
vote
0answers
20 views

Dropzone upload and SQL has no effect

My upload feature using dropzone does not seem to be following through in adding an a new row in my SQL or uploading the actual picture. The main point is that he dropzone triggers using PHP on button ...
0
votes
1answer
18 views

Why Larecipe can't load correctly?

I installed Larecipe in the project and he can't load correctly. When i see "/docs/1.0/overview", get errors in console and layout can't be load. Uncaught ReferenceError: CreateLarecipe is not ...
-4
votes
0answers
14 views

BadMethodCallException : Method Illuminate\Database\Query\Builder::getLoginNames does not exist

BadMethodCallException : Method Illuminate\Database\Query\Builder::getLoginNames does not exist. <?php use Illuminate\Database\Seeder; class DatabaseSeeder extends Seeder { /** * Run ...
0
votes
0answers
20 views

How to link multiple rows within a single table - MySql

I'm looking into a way on how I can link multiple rows within a single table. In short, this is a system in which users can add messages. Messages are linked to a division. A user can post a message ...
-1
votes
2answers
47 views

If else with same code, but different condition

I have got an if/elseif statement, both with the exact same code, but I want to trigger them depending on the condition. I have got the exact same code duplicated in the if statement aswell as the ...
0
votes
1answer
17 views

404 error file not found while insert data into database using laravel 5.4

I am new in laravel I am simply wants to insert form input field data into database using jquery ajax but now problem is that when I click on submit button it show 404 error but when I write localhost/...
0
votes
0answers
14 views

Detect if the php script is called from schell_execute or is being run manually

We have a case where our handler is being called from an shell_execute. Our Debugger then thinks he is being called from the user from the cmd directly and outputs true. we need to handle on it. any ...
2
votes
1answer
15 views

Change sorting of WooCommerce My account customer orders

In WooCommerce, customers can log in to their account and see the order history. By default the orders are displaying with the newest order date first. I want to turn this around, so the order with ...

http://mssss.yulina-kosm.ru