Questions tagged as 'php'

2
answers

How interesting is APC to use? Is it recommended to use it with objects?

I have read about the PHP opcode cache, the APC. Most of the materials I found to read, although good, only explain the installation / use of APC functions. What I would like to know is: How interesting is APC to use? Is it recommended...
asked by 11.02.2014 / 21:17
3
answers

Login system security

Hello, I've done a torrent file download and upload system, and this site has a login system with a database, and I'd like you to explain a little about security in PHP and mySql and what should I do to maintain the security of the site. If yo...
asked by 12.05.2015 / 02:12
2
answers

Order array for a property

I'm trying to sort an array by a specific property (weight), I found some possible solutions but they did not work for me, could anyone tell me where I'm doing something wrong or another way out of my need? How am I trying to sort: functio...
asked by 19.03.2014 / 15:52
1
answer

Invalid parameter error while doing PDO take action

I'm trying to learn how to use PDO, so I've already gone VERY looking for everything to understand it. So I'm at a point that left me pretty confused. I have the following code, it is the: _conecta_banco.php <?php class conectar_banco...
asked by 12.06.2014 / 05:42
2
answers

How to retrieve a large array in PHP quickly?

In the example below, I have a array in PHP with about 128,000 records that I retrieved from another file, and I use it in some applications to compare indexes as HashMap . > array(128521) { [0] => string(3) "aba" [1] =>...
asked by 11.01.2014 / 07:34
3
answers

Disable Auto Redirect after login in CakePHP 2.4

I'm using CakePHP 2.4 Auth and if I try to access a link that needs to login it redirects to the login form. For example: I try to access: / projects / edit / 34 without being logged in. Then CakePHP redirects to / login. After informing the...
asked by 08.01.2014 / 19:19
3
answers

Doubt with PHP and Apache

I formatted my machine and was advised to use Linux, and so I did. But in my localhost , the .php files are not read / recognized, only the .html files. I installed, reinstalled and did everything I saw on the internet, bu...
asked by 12.05.2015 / 20:01
2
answers

How do I store and read settings?

Imagining that I have a small site, and this site stores and returns information from the database. I currently see a lot of people storing the login data for MySQL or paths in PHP variables or defines constants. <?php ... $db_host = "l...
asked by 30.11.2015 / 15:39
1
answer

How to implement editable table, updating the fields in the database automatically

I have the following table that lets you edit cells directly: The codes are in 4 parts:    MySQL table CREATE TABLE IF NOT EXISTS 'php_interview_questions' ( 'id' int(8) NOT NULL, 'question' text NOT NULL, 'answer' text NOT NULL,...
asked by 20.01.2017 / 19:20
1
answer

How do I throw my own exceptions with PDO?

When executing the line below, in the constructor of my database access class: $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); The PDO will report errors by throwing exceptions of type PDOException . Is ther...
asked by 24.01.2014 / 04:13