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
8 views

php Symfony 3 pass dynamic entity manager into Request Listener

In my Symfony 3.4 project I got several databases which are managed by one entity manager. Consider the following code: config.yml doctrine: dbal: default_connection: default ...
0
votes
0answers
25 views

Is there any way to compare 2 password hashes

At my job, we're using a custom built CMS and we're trying to implement a new feature where we can login to our customer's websites which use the same CMS as we do. We used to store the passwords on ...
-4
votes
0answers
18 views

Cómo una página web puede insertar información a una base de datos con AJAX [on hold]

Necesito hacer una consulta como en la del ejemplo de w3school pero en INSERT. https://www.w3schools.com/php/php_ajax_database.asp Lo he estado intentando y me da: jquery.min.js:4 POST http://...
-1
votes
0answers
18 views

Better way to obfuscate parameters?

I have been using an old function in some of my projects across several years to obfuscate the parameters when needed. And now, im starting a new project focused in performance, and my function it's ...
-3
votes
0answers
18 views

Concatenate single array using php

I have a sample array. I want to merge into single row as header and values will be added below to respective header. I have tried but my bad luck unable to get bring that. In below i'm sharing sample ...
0
votes
3answers
21 views

Laravel how to add records with create function in controller?

NewsController.php This is the contoller and i use the create function to add record to the database but when i add all records will be empty public function insertNews() { $attribute = [ ...
-3
votes
0answers
4 views

Direct video uploading using PHP and youtube API

Can someone provide me with a link to a good tutorial? I have tried some of the sites, but they demand "Location(Domain I guess)" when creating a project on console.developers.google.com
0
votes
0answers
27 views

How to pass data to the server using javascript? [duplicate]

Hello I'm trying to pass xmlHttpResponse object to the php server using javascript. I am having an url (http://172.16.73.199:4848/Exports/8757e920-838c-4844-a48a-27a1f3325052/be483c2b-9b9a-401d-addb-...
0
votes
2answers
9 views

How to wrapper PDO Class?

I need to wrap PDO class to the new class. The problem is after wrapper some method it can't access other method. in below code. it wraps query to perform try catch and return error. But, after i ...
0
votes
0answers
8 views

How can I call a page when i clicked the button in codeiginiter?

I am not calling a page in codeiginiter when i click button.. i am new in this so please HELP.... <li> <a href="#"><i class="fa fa-check-square-o nav_icon"><...
-2
votes
1answer
16 views

PHP division precision

I'm doing this division : $a = 26.25; $result = $a / 100; // Result : 0.26 How can I have a float number with more precision ? The result I want is 0.2625, not 0.26. Thank you.
0
votes
0answers
8 views

How to install PHP 5.x version with Apache 2.0 and PHP 7.x version with Apache 2.4 in Ubuntu 16.04 machine

I'm setting up two servers in a single Ubuntu 16.04 machine with PHP version 5.x with Apache 2.0 and PHP version 7.x with Apache 2.4. I don't have prior experience setting up this. Kindly help.
0
votes
0answers
17 views

Website's CMS works locally but gets a error when uploaded live

I'm getting this issue where my CMS webpage has no problems working when access locally via xampp, but as soon as I upload it to my cpanel, I get the error 500 shown below. I tried using clear ...
0
votes
0answers
7 views

How to get add.html for Amazon Api mobile friendly

We are using the API with the add.html to add products to the Cart. But the add.html is, let me say completly useless on mobile phone or even tablets. The add.html is to small to read. There is a page ...
0
votes
1answer
24 views

How to get specific data from table1, use it in table2

I'm trying to get specific rows in table 1 (stellingen). I want to store these rows to specify the rows im interested in for the second table (stelling). So lets say table 1 has 5 rows where stelling ...
0
votes
0answers
17 views

search groups of string where order of groups is irrelevant [duplicate]

I have groups of some string and I need find all groups by regular expression where order of groups is irrelevant Please, I need locate all necessary ingredients in user's answer. User can put ...
0
votes
0answers
10 views

Send Laravel/Lumen logs to Seq

I'm implementing a logging system in my Lumen microservice to not use the default Lumen log. I'm trying to connect the microservice to Seq, but I found no way to do it. I looked at the way to ...
0
votes
1answer
29 views

Errors when sending an array in post in PHP

I'm currently trying to send data with html input checkbox to my php page. There is how I generate my input : Sending ajax call and get back data from database Create input with callback Add input ...
0
votes
0answers
8 views

Inject <customTag> within text using DOMDocument

I would like to add a custom tag within a certain part of a text node using DOMDocument, my problem is that I can't figure out how can I locate that specific part, for example: "Lorem ipsum dolor ...
0
votes
0answers
20 views

How to pass variable from php to javascript [duplicate]

I am using function to load php file. And I wanna pass the variable from that php to javascript. I have already used echo to retrieve it but didn't work. Is there any solution for it? Javascript code ...
-1
votes
0answers
5 views

How to puch individual streams to remote social media platforms from nginx

I have successfully been able to push an incoming stream to multiple social media platforms. What I am attempting to do however is push individual streams to individual social media platforms. I ...
0
votes
2answers
21 views

Check upload file validation -Laravel

Only validation check if file upload. (file exist) if not upload file then need not check validation (In laravel validation)
0
votes
2answers
24 views

Can i make variable accessible in two files without include?

i want to create variable in file a.php like <?php $string = "hi"; ?> and in file b.php make this code work without including a.php <?php echo $string; ?> edit : one of files (a.php ...
-3
votes
0answers
14 views

Injection data to third party form

I have bunch of usernames and passwords for my customer in server. Most of them using different CMS and I want to make a script to inject their username and password in backend CMS login form (single ...
2
votes
2answers
34 views

Most efficient way to execute a large SQL query using PHP?

Every three months i am required to upload a CSV file which contains around 400,000 products and insert them into a MySQL Database. I don't feel my method is very efficient and would like some ...
0
votes
0answers
14 views

url with &amp; return get variable like amp;var [on hold]

I use a link with two parameters so I do this : header('Location:../index.php?action=accueil&amp;num=23'); But when I do print_r($_GET); I got this : Array ( [action] => accueil [amp;num] => ...
0
votes
1answer
14 views

Without SELECT: Cannot execute queries while other unbuffered queries are active (INSERT INTO/ANALYZE TABLE/BEGIN TRANSACTION)

I got the error: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run ...
-3
votes
0answers
29 views

How do I use Binary.com API? [on hold]

I am a binary options trader and I would like to use API source given by the broker, but it looks very hard to figure that out using API. For example: if I want to Purchase (Higher) EURUSD under 30 ...
1
vote
3answers
23 views

FORM don't submit anything

I have some php and html code, what I want to do is just catch the data from form and print it in one file. But when I click submit there is no data. I've tried to break the code to be 2 part but ...
0
votes
1answer
15 views

I want to create a URL from the values given in multi dim array ,and if i add one more array (now 3) then automatically more URL should create

` d a`, 'surname' => `smith`, 'place' => `a us`, ], [ 'name' => `d a e`, 'surname' => `col`, 'place' => `e n g land`, ], ]; include 'index_common ....
1
vote
1answer
15 views

Require all blocks found in folder (rather than write them all out)

I'm creating custom elements for Visual Composer WP Plugin. In functions.php, I'm referencing each block so that it loads in the admin side: function vc_before_init_actions() { require_once('...
-1
votes
0answers
18 views

It show me blank output and the the rest of my webpage not displaying [duplicate]

I've been staringly blanky at this error and can't seem to know what the problem is. When I run the query I get this error: echo "<select class='custom-select' name='category_name'>"; while ($...
0
votes
0answers
15 views

File, search and replace between tags

desolate for my bad english I have a file with many products example below, I am looking for a solution to modify the data example if several rename the 2nd model by and and and etc ... <...
-2
votes
0answers
30 views

PHP-DI using previously defined class [SOLVED]

I am trying to improve my PHP-DI config, and now I stuck. I want to reuse an already defined class for another class. entityManager class should come from Database->getEntityManager Here is a ...
3
votes
2answers
55 views

Why does the image is not showing correctly using CSS?

I am new in learning web development especially in PHP and using CSS. The image that I have has 2560 × 1600. Is that size already enough to cover your background entirely? I only intended to put 1 ...
-2
votes
2answers
22 views

How to run a sql query with a WHERE LIMIT using variables

I need to run a SQL query with a where and a limit clause I seem to be having an issue with running when I include the where clause Warning: mysqli_fetch_array() expects parameter 1 to be ...
1
vote
0answers
24 views

AJAX works fine but PHP won't receives data

This is one of the weirdest problems that I've seen Ajax sends datas correctly (I guess) but Php won't receives them I've tried to change url to current page and it returns me empty and the success ...
0
votes
0answers
25 views

i want to get image from public folder in laravel inside blankURL : 'public/assets/images/blank.gif', in this path

$(document).ready(function() { $('.zoomple').zoomple({ // specifies the source for the blank image. blankURL : 'public/assets/images/blank.gif', // background color bgColor : '#90D5D9', // ...
1
vote
0answers
29 views

Is there any better approach on this rows to columns table?

I pass a function into the variable ($monthly_receivable) to get the value of each months to pass and get the result of a function.. but the process is dumb slow. This was the only january data but it ...
-2
votes
0answers
11 views

How to save some content of an html page into a pdf file by using php or python?

Please help me. I want to save some content section, not the whole page, of an html page into a pdf file. The method with take URL as input, it does some manipulation to extract some content but keep ...
0
votes
1answer
19 views

Add rows in a html file from an external php file

I'm trying to find how to insert a row line to a table in html so , but i would like to do it using an external php file, but maybe another solution because the purpose is to get a table from a ...
-2
votes
1answer
37 views

How to pass an id of current item to request table

I have an application where a user can send request edit to the admin, now the problem is how to store the id of the requested asset from user_asset table to the request table so I can display it to ...
0
votes
2answers
44 views

how to pass json encode to javascript in PHP?

i want to encode a json because it contains special characters I try to use simple urlencode but it doesn't work. When I print the variable in alert on the js is empty $sql="select name,surname ...
0
votes
1answer
25 views

how to add auto generated alphanumeric key in id_column

What happens is a user comes on site, fills create a new product form with title, description, price et cetera fields... I want to store a unique generated alphanumeric key in my 'id' column which is ...
0
votes
0answers
10 views

how to lookup in an embedded doc and that embedded doc have an id using mongodb

I'm using mongoDb in my project, and I have problem using lookup on embedded data.. I searched for my problem and read similar codes.. but they didn't help my problem.. I mean in my embed document ...
0
votes
1answer
37 views

laravel new project not running still loading in browser

installing laravel new project composer create-project --prefer-dist laravel/laravel newProject Project running perfect in http://localhost:8000/ in this port after some time page loading stil ...
-1
votes
3answers
34 views

Return the values from an array that dont appear in the other

I am looking for a way to compare two arrays to each other and return the values from one that doesn't appear in the other. Let me simplify the question with an example. I have an array called ...
0
votes
0answers
27 views

My function is getting duplicate tree nodes

My function is duplicating some nodes on the tree. When I am calling that function in a recursive way. I know it's showing because I am passing instance, but if I am not then the array is not having ...
2
votes
1answer
36 views

Using PHP namespaces in included files

I try to use namespaces with included files: <?php namespace MyNamespace; function foo() { echo 'Test'; } include( 'otherfile.php' ); ?> Inside otherfile.php is a <?php foo(); ...
0
votes
0answers
14 views

get_headers: failed to open stream: Connection timed out

I was using get_headers to check a file exists in 5 front-end servers. But some file is opening, for some file it shows connection timed out error. stream_context_set_default( [ 'ssl' =&...