Questions tagged as 'php'

2
answers

What is the best way to turn a secure contact form?

I have a working contact form but it has a cross-sectional security hole in sitelock. Any help with overcoming the problem? Thanks <?php header('Content-Type: text/html; charset=utf-8'); if(isset($_POST['email'])) {...
asked by 12.05.2017 / 14:46
1
answer

Find character in php array

Imagining that I have the following array: $o_meu_array = array("123_rui", "125_joao", "287_manuel"); Now I want to find inside my array "123". When I find 123, I want to replace 123 with another value given by the user. For example, if the...
asked by 27.06.2014 / 16:32
1
answer

Persistent connection to the Mysql database [closed]

Hello, I would like to know if I have an open database connection (persistent connection) is better than I always close after a query?     
asked by 31.07.2014 / 18:39
1
answer

Automatic remote upload of zipped file in PHP

I have a PHP e-commerce system installed for several clients. However, every time I upgrade to the system, I have to manually upload the new files to all the clients. I'd like to automate this. One solution I thought was to upload a ZIP file...
asked by 01.07.2014 / 23:09
1
answer

PHP Error: "Can not use function return value in write context"

This error is appearing to me and I can not understand why. The line of code is as follows: $matrix(0, $key)=$quantidade['id_product']; The full function is as follows: public function sumQuantidadesPorProduto() { $quantidad...
asked by 20.03.2017 / 12:24
1
answer

Problems do not implode when bringing results from the database

I have a table where I store access permissions to a system. It looks like this: Sofarsogood,butlistingthepermissionsofeachuser(onlyhas02usersregistered)intheadministratorsview,isbringingdataduplicity.ThecodeI'musingis:while($jmVisualizar=my...
asked by 25.03.2017 / 19:12
2
answers

How to insert an item in a certain position of the php array?

I have the following array, $status = array(); $status["Visualizar"] = "Visualizar"; $status["Editar"] = "Editar"; $status["Status"] = "Alterar Status"; $status["Boleto"] = "Gerar Boleto"; It turns out that depending on the current status t...
asked by 04.04.2017 / 20:17
1
answer

How to create a recursive anonymous function (Closure)?

In php, we can create functions with recursion as follows. function quack($quack = 1) { if ($quacks >= 1) { echo "Quack"; $quack--; quack($quacks); } } Or, in case of avoiding problem with "renames" function....
asked by 28.07.2015 / 17:57
1
answer

PHP and MySql Session

I have two tables, one for login and password, and one for user data such as address, phone, etc. After signing in I would like the data displayed on the screen not to be the login, but the person's name, with a telephone address. The se...
asked by 21.08.2015 / 13:25
1
answer

Foreach behavior with variables by reference

I was doing some testing and I noticed that foreach behaves oddly. Suppose I have the following array : $array = array('primeiro', 'segundo', 'terceiro'); When I run a foreach using a reference, and then another forea...
asked by 14.08.2015 / 18:18