Questions tagged as 'php'

2
answers

Insert points on a map with an array that passes in the database

I'm creating a site where I need a map, and users fill out forms with latitude and longitude to create a point on that map. Everything is stored in the database but I needed the point name, latitude, and longitude to be passed in an array first....
asked by 20.01.2017 / 18:18
1
answer

CodeIgniter 3 - Structure of subdirectories - Routes

I created a project in CI and I'm going through the following problem: I split my controllers into two folders: application/controllers/painel/ and application/controllers/site/ In the subdirectory panel there is the home controller an...
asked by 19.01.2017 / 11:25
1
answer

Destroy (Logout) Session_ID Codeigniter

Through the code below I retrieve all users logged into the system and display them in a table. <?php $dados = array( 'session_id', 'ip_address', 'last_activity', 'user_data' )...
asked by 24.01.2017 / 19:30
1
answer

Know the name of the object in JSON

I have a JSON and I need to know the name of my object and the values it has, for example: {"Pessoas" : [ {"Nome": "Welson Play", "Idade":19}, {"Nome": "Stephanie", "Idade":15}, {"Nome": "João P...
asked by 08.07.2015 / 13:11
1
answer

Export array inside a table?

I need to export data from an array inside an html table, the function is working but I do not know how to export with while inside a table, I made an analogy with the code below. function imprimir_Tbl($Id, $Nome){ $array = array(); for($i=0;...
asked by 10.01.2017 / 13:48
1
answer

PHP - CURL Session finished?

I'm trying to create a theft to automate a process, as post here: Automate process - Robot? Given the suggestions, I'm following using cURL. What is happening is the following: It manages to login, goes to the second page where the form is...
asked by 26.07.2015 / 00:04
1
answer

Inform or not the view inside the controller in php?

I created a framework for my own use, a bit for understanding how an fw works, but it turned out to be a basic working tool. I know that many will say that one should not try to reinvent the wheel. But I'm not trying to do this, I'm just wanting...
asked by 20.06.2016 / 03:27
2
answers

Is there a try-with-resource in PHP?

Is there something like PHP try with resource in Java? Or do I have to close resources in the block of finally same?     
asked by 02.10.2018 / 05:03
1
answer

What is the best way to perform a dependent addition / subtraction operation?

It is common when you first encounter this doubt. I have to perform an operation that is dependent on a condition: Example 1 $operacao = 'somar'; $valor1 = 5; $valor2 = 10; $saldo = null; if($operacao == 'somar'){ $saldo = $valor1...
asked by 26.01.2016 / 12:40
1
answer

Pass a JSON from the view to the route

I'm trying to send JSON of view to a route, but I can not. Unfortunately I know little about JSON , ajax , GET and POST . In the view, json: var json = { "numeroMesa": numeroMesa, "itens": itens }...
asked by 03.02.2016 / 16:53