Questions tagged as 'php'

1
answer

PHP calculates distance between cities

With the code below I can calculate the distance from one city to another, but I can only put cep's would have some way of using the proper names of the cities instead of the zip codes? $i = 0; $arr = array('90450000','95180000'); foreach ($a...
asked by 15.09.2016 / 20:33
1
answer

How can I find out the method of http request by PHP? [duplicate]

I know that every HTTP request made, either by the browser or another resource, sends a certain method ( GET , POST , PUT , DELETE and so on). I'm thinking of building a Restful application with PHP, but I do not kn...
asked by 12.08.2016 / 20:10
1
answer

Treat Javascript Postback

Opa, I have a page that runs a SetInterval of seconds in javascript, this page captures the data of the divs and sends via post, being that this data sent is not fixed, sometimes it can be sent 1 or more than one. In sending, I treat this...
asked by 12.08.2016 / 20:01
1
answer

Disable composer require with php

I have an example of JSON : { "name": "xxxxxx", "description": "xxxxx", "type": "beta", "license": "MITS", "authors": [ { "name": "Leonardo Vilarinho", "email": "[email protected]"...
asked by 11.07.2016 / 02:23
2
answers

Search for something in a list and say whether it exists or not - Display Value, and sum of quantity

Good afternoon, what is the easiest way to make a list that contains multiple items, for example meat, fish, pao etc, and from the $ _GET multi-item know whether the product exists or not? I tried to create an array and do with array_key_exist b...
asked by 08.07.2016 / 19:00
1
answer

Run Xdebug on netbeans to debug Codeigniter

I'm trying to debug an app in codeigniter through xdebug on Netbeans. However when I run my app in debug mode, I can not get to my controllers or any breakpoints after the first line of codeigniter index.php. I am running codeigniter 3.0 on x...
asked by 08.07.2016 / 19:08
2
answers

How to check if at least 1 checkbox has been selected?

$carrosbr = $_POST['carrosbr']; $carrosin = $_POST['carrosin']; $corp = $_POST['corp']; $houses = $_POST['houses']; $vip = $_POST['vip']; $skins = $_POST['skins'];...
asked by 07.07.2016 / 21:31
1
answer

PHP function always returning NULL

I have a function in PHP that is always returning NULL and I can not understand why. The variable I am trying to return is a multidimensional array. When I give var_dump to the variable it has the correct value, but the return by the f...
asked by 07.06.2016 / 12:21
1
answer

Random selections with PHP and MySQL

Is there any way to make random selects with php and mysql. Example: I have the table carreta_furacao: id----nome 1----Fofão 2----Capitão América 3----Popeye 4----Mickey 5----Palhaço 2 - In PHP I make a random select * 3- Ret...
asked by 08.06.2016 / 20:17
1
answer

Add value to the database

I use Codeigniter, and the situation is this: The product has a current stock, and I want to input more items from this stock ... how do I add the existing one with the new entries? Here is the code: CONTROLLER: public function entrada(){...
asked by 25.07.2016 / 21:45