Questions tagged as 'php'

3
answers

How do youtube know which videos we have already watched?

The question by itself already describes my interest, but what I'm really wanting to know is how youtube stores the information saying that we've already watched that video. I thought about storage with cookies, but it would be unfeasible since...
asked by 23.07.2014 / 23:43
2
answers

The less you consult the better, right?

It is possible to vary the writing of the results, as an example below where I want to use. <table width="1000" align="center"> <tr> <td>&nbsp;NOTICIAS</td> <td>&nbsp;</td> <t...
asked by 04.04.2015 / 15:02
3
answers

Upload only thumbnail videos from Youtube

I have a page that in your layout there are 20 Youtube videos, it's a listing. Since I do not want to make this page really load all these videos to not understand the performance of the site, because iframe weighs a lot. I would like to...
asked by 20.06.2014 / 13:59
3
answers

How to sum the results of an array brought from the database in PHP?

I'm doing this, but what's being added is the number of rows and not the values of the "something" field. <?php $searc= mysql_query ("SELECT algo FROM lugar") or die (mysql_error()); while ($rows = mysql_fetch_array($searc)) { $soma_das_...
asked by 30.04.2014 / 15:32
2
answers

How to create a number generator from an Initial number and a Final number?

I do not know if it is done in php or javascript, I have read tutorials but I could not get anywhere ... I would like to create a system for me to put an initial number and an end and in that interval would have 20,000 numbers and that were gene...
asked by 16.07.2016 / 19:52
3
answers

Add "name" to a JSON object

My JSON currently returns this low code: {"2":"aluno","8":"barbara_cristina","13":"carolina_deus"} How do I add a "header" in numbers 2, 8 and 13? I wanted it to look like this: {"nome":"aluno","nome":"barbara_cristina","nome":"carolina_d...
asked by 14.04.2016 / 18:40
3
answers

Insert into the database table with the second form

I have this menu: <nav class="menu"> <ul class="menu-list"> <li><a href="#">Produtos de Higiene</a> <ul class="sub-menu"> <li><a href="#produto_1">No...
asked by 03.07.2018 / 13:09
2
answers

Difference between file_get_contents and curl?

I wonder if there is any difference between using cURL and file_get_contents and which one is safer? Home Thanks in advance.     
asked by 13.06.2016 / 18:31
3
answers

Array sequenced within dropdown

Folks, I have a code that starts the arrays if I set the values, but I would like this sequence to be automatic. Let me show you to get clearer. <?php $busca_produtos = new Produto; $produto = $busca_produtos->busca_todos_produtos()...
asked by 04.09.2018 / 14:35
3
answers

How to list the properties of an object in php using foreach?

I have the following class: class Usuario{ private $nome; private $profissao; function setNome($nome){ $this->nome = $nome; } function getNome(){ return $this->nome; } function setP...
asked by 02.08.2016 / 16:26