Questions tagged as 'php'

1
answer

Ajax locking page exchange (LongPolling)

I am trying to complete a connection using Long Polling, where the browser sends a request to the server and is waiting for a response. To prevent this port from being infinitely open, I created a routine so that every 10 seconds the server send...
asked by 17.10.2014 / 16:03
3
answers

How to pass a json containing data array to Php?

How could you send the following Json to Php without missing the " tabs " part, where you have an array !? The original Json is made up of a single line, so I put it here just to improve the view: {"csTipoPagamento":"20", "csClassificacao":"14...
asked by 02.07.2015 / 04:51
1
answer

How to get the last query executed by CakePHP?

I want to get the last query executed by CakePHP Example $data = $this->Ticket->find('all', array('conditions' => $conditions, 'order' => array('Ticket.id' => 'DESC'))); $this->query = $this->Ticket->getLa...
asked by 11.07.2014 / 23:41
1
answer

How to replace the HTML content of a div using DOMElement of php

I'm trying this way libxml_use_internal_errors(true); //pegar o conteudo de um pagina web $doc = new DomDocument(); $doc->loadHTMLFile('http://www.astralsaudeambiental.com.br/'); $div = $doc->getElementById('sidebar'); $string_div = '';...
asked by 25.07.2014 / 21:52
5
answers

How do I get the name of the variable used in the function argument?

Script1.php Here script1.php calls the function that is in script2: sendData($variavel); Script2.php The function receives the value and includes the script 3 to receive the values of the arguments: sendData(){ $getFirstAr...
asked by 16.08.2014 / 18:21
1
answer

How to call modal window with parameter in bootstrap?

I would like to know how I can call opening a modal window in the bootstrap by passing a parameter. The idea is to open the inserted invoice item to edit the quantity.     
asked by 19.08.2014 / 03:30
1
answer

Break a number in equal parts

I have the variable $peso that oscillates between 1000 and 50000 (grams) There is a freight table that I have as 1000a2000 => 10,00 2000a3000 => 20,00 ... 9000a10000 => 100,00 kg_adicional => 2,25 I have i...
asked by 24.11.2015 / 14:17
1
answer

Malicious code on all pages [closed]

Hello, I went to access cPanel and saw through the browser that some script was being loaded from another site. When viewing the source code, I came across the following code: <script src='http://grugol.com/prog/landing.php?app=MjAtODktODQt...
asked by 23.11.2015 / 13:45
1
answer

Json with relationship ManyToMany - Laravel

I created a relationship between my tables using ManyToMany and I currently need to return a Json with the information, but my tables are found like this; // 1. Produtos +-------------+ | id | | name | | description | |...
asked by 02.12.2015 / 17:48
1
answer

How to bookmark an event in datepicker?

I have this code in javascript: $(function() { $("#calendario").datepicker({ changeMonth: true, todayHighlight: true, changeYear: true, showOtherMonths: true, selectOtherMonths: true, date...
asked by 10.12.2015 / 12:23