Questions tagged as 'php'

1
answer

Replacement of special characters by ASCII codes

I'm setting up a site built in charset and when I move to UTF-8 the special characters appear on the screen with that diamond and a question mark, so in addition to charset I need to change the characters by ASCII codes. Ex: á - &aacut...
asked by 16.12.2014 / 18:10
2
answers

Insert data into database according to number of checkboxes

I have form where I have fields with chekboxes and I want to know if it is possible to make as many inserts as selected fields. In other words, if the user chooses 4% with% I make 4% with%, is it possible? If so, how can I do it?...
asked by 29.01.2015 / 19:26
2
answers

How to release a sub-directory protected with .htaccess?

I have .htaccess in my test environment developed in CakePHP and the .htaccess has authentication so that not anyone is accessing it. Now I need to release a directory from the site, actually a CakePHP plugin, I need anyone to have acc...
asked by 07.01.2014 / 19:28
1
answer

PHP code refactoring to provide image with specific size

The code below aims to provide an image with specific measures to minimize its size and thus optimize web-site loading. Problem The image takes more than 1 second to render, making it a heavy load on the initial upload of the web-site:...
asked by 12.03.2014 / 19:55
6
answers

Error installing Composer on Project in Laravel 4

I'm starting in the Laravel world and I'm having a problem running the composer install on the project. When running the command, it shows the following error: D:\htdocs\cpi2>composer install Loading composer repositories with packag...
asked by 09.01.2014 / 13:24
2
answers

How does the Laravel 4 Query Cache work?

I'm trying to cache my query, but I do not know how to recover the data later. Another question: when the number of rows in the database increases, does it automatically redo the query cache, or every time I enter the page does it cache the quer...
asked by 12.01.2014 / 07:22
3
answers

How to open an .php file that is in a subdirectory?

My index.php has this script inside it: <?php $pagina = empty($_GET['p']) ? 'home' : $_GET['p']; switch ($pagina): case 'contato': $titulo = 'Contato '; $keywords = ''; $descricao = ''; break; case 'privacidade': $tit...
asked by 29.08.2018 / 18:31
2
answers

Count friends in common using LEFT JOIN

I have the following tables: users : id | usuario | pnome | snome | foto 1 | Igor | Igor | Souza | perfil.png 2 | Alex | Alex | Khal | foto.jpg 3 | Maria | Maria | Silva | foto.png Friendships : id | amigo1 | amigo2 | e...
asked by 03.05.2016 / 18:05
2
answers

How to find a link inside an html file and switch to another link?

So far I've only been able to find out if a link exists in the file, but I do not know how to do the exchange. My code is this: $nomeArquivo = $_POST['nomeArquivo']; foreach ($arquivos as $a){ $aq = fopen($a,"r+"); while (!feof($aq)){ $l...
asked by 08.02.2016 / 02:52
1
answer

Remove duplicate elements in Array

I am getting an array by JSON , and using array_unique to remove duplicate values, however, it is displaying the following error: <b>Notice</b>: Array to string conversion in <b>/var/www/html/.... </b> on...
asked by 26.08.2015 / 17:08