Questions tagged as 'php'

3
answers

Find Strings in Text Files in PHP

I have a file named "test.txt" inside it has several words, I have an input where I get the inserted word and would like to check if this word is contained within this ".txt file". Does anyone know how to do this?     
asked by 19.10.2017 / 14:30
1
answer

Resize images by passing the values through the url

In my program downloads site, there are images of various sizes, for example: for each program has a thumbnail, a large image and the screenshots. I just want to make the images all of the same size and by the url pass the size I want from th...
asked by 18.07.2017 / 16:06
1
answer

Autocomplete locking the database

I'm developing an application in PHP and Jquery with the framework Codeigniter 3. I'm using Postgre and I have a database with more than 1 million registered registrations. I made an autocomplete that looks for the name of a product in the da...
asked by 21.07.2017 / 06:44
1
answer

How to create optional parameters in SoapServer

I'm using the PHP native class to create a Soap server. Example: class Bar { public function getDrink($age, $money, $name) { if ($age >= 18 && $money == 5): $drink = "Heineken"; else: $d...
asked by 19.07.2017 / 16:41
2
answers

Number of simultaneous requests that a PHP server supports

Let's say I have a server with an i7 processor with 4 cores / 8 threads. On a multi-threaded architecture, assuming you create a thread on request, only 8 concurrent requests will be allowed, since the processor has 8 threads ? If PHP...
asked by 22.09.2017 / 20:01
1
answer

Is my database access role secure?

I have a file that has CRUD operations with PDO and MySQL, my question is if I leave my functions as the function below: function delete($tabela, $id) { global $con; $sql = "DELETE FROM " . $tabela . " WHERE id=:id"; if(is_arra...
asked by 25.09.2017 / 00:36
1
answer

Doubt with SQL / PHP

I have the following query: $qrysel = "select * from pack"; $ressel = mysqli_query($db, $qrysel); $obj = mysqli_fetch_object($ressel); In html I have this: <?= $obj['pack_name']; ?> How could I make it show the value according to...
asked by 25.09.2017 / 20:10
1
answer

Return an in_array () true within an SQL result

I have a function inside the class UsuarioVisitas : // Retorna o array com os mais visitados public function CS_GetMaisVisitados($sql_aux) { global $objConexao; $strSql = "SELECT cod_usuario, SUM(count_view) AS total_visitas...
asked by 26.05.2017 / 17:47
1
answer

Loading on demand

I am trying to make a load system on demand and I do not know anything about ajax and I did not quite understand how it would work. I have a post system that shows a 10 post quantity on my page, and when I click on my second page (pagination)...
asked by 25.05.2017 / 05:20
1
answer

Warning: mysqli_query () expects parameter 1 to be mysqli, integer given

I have this code below: <?php $conecta_no_banco = require_once ('conecta_db.php'); $login = $_POST['login']; $senha = $_POST['senha']; $sql = mysqli_query($conecta_no_banco,"SELECT usuario FROM gerenciador_de_socios.autenticacao_usuarios")...
asked by 25.05.2017 / 07:17