Questions tagged as 'php'

3
answers

How to invert data [duplicate]

I'm trying to invert a date variable that displays the results like this: 2016/05/20 But I want a function in php that looks like this: 20/05/2016 How to do this?     
asked by 08.05.2016 / 18:32
1
answer

Order collection of products interleaving according to flag

I have a model called Product which has, in addition to the product data, a featured flag that says whether the products are highlighted or not. At the time of mounting the view the products should be displayed according to the fol...
asked by 25.01.2017 / 15:58
1
answer

Simulate _GET php in string

I have a string to simulate: <li><a title="string" href="http://geting.com/?v=123?t=abc">Opção 1</a></li> I would like something that takes the parameter ?v= , just it, same as when we get the method $_GET["...
asked by 26.11.2018 / 20:54
2
answers

How to display an image without an extension through the direct link in the browser?

Example - http://meusite/imagem/001 Result that I do not want, I want to see the image. ÿØÿà�JFIF��H�H��ÿÛ�C� ÿÛ�C ÿÀ�p�"�ÿÄ������������ ÿÄ�7����!1A"Q2a¡Bq‘#3R$CbScðÿÄ�����������ÿÄ�)�������!1A"Q2a#BÿÚ���?�ù¶¨/d99ñI­”s...
asked by 12.09.2016 / 16:51
1
answer

Instantiate objects dynamically

When I create a new object inside the loop, which has the name in $sizeName , and I try to access the getUrl() method I get:    Fatal error: Call to a member function getUrl () on a non-object in ...   online 58 foreach ($this...
asked by 13.09.2016 / 18:42
1
answer

Cookie does not exist

I'm trying to pass some data from one page to another, but it's not working correctly.    link <?php $nome = "JOSIMAR"; setcookie("nomee", $nome); echo "<script type='text/javascript'>window.location=' ../demostracao/usuarios/in...
asked by 15.09.2016 / 16:13
1
answer

Check the difference between two dates in months

I need to put a code in php where I report 2 dates and it returns the difference in months. Example: $data1 = "2016-03-01"; $data2 = "2016-06-10"; Resultado 3 meses Example 2: $data1 = "2015-06-01"; $data2 = "2016-06-10"; R...
asked by 10.06.2016 / 13:47
1
answer

column does not obey the where statement of an update

I have a problem. At the moment I do an update, when I use the where only the line with the informed code is updated. but the description field that I inform, its contents is replicated for all the lines of the bank this is the only column that...
asked by 09.06.2016 / 16:29
1
answer

How to make a button in PHP, send data to my mysql table?

I placed a button on my page to send the data to a table in mysql. <button type="button" class="btn btn-block btn-primary">CADASTRAR</button> How do I, when I click the button it does the register operation in the table, the exa...
asked by 13.06.2016 / 18:24
1
answer

where for inner join

As I have three WHERE tables select login, nome_hotel from extranet_login, extranet_hoteis, hoteis where extranet_login.id_login=extranet_hoteis.id_login and extranet_hoteis.id_hotel=hoteis.id_hotel and extranet_login.login='admin'; for...
asked by 09.06.2016 / 11:06