Questions tagged as 'php'

5
answers

Use if inside foreach

I am trying to change the order in which the results appear within a loop using foreach. What I need is for numbers greater than five to appear first, followed by the rest of the numbers. So I tried something like this: $numeros = array(1, 2,...
asked by 09.05.2014 / 19:47
4
answers

How to delete the database from the database if the user does not activate it by email within "X" hours?

Well, when registering on the site the user has their ACTIVE set to 0, so with the code I posted in the question answer below I can update the ACTIVE to 1: How do I activate a user's registration by email? But if the user does not activate...
asked by 21.08.2014 / 17:06
3
answers

With the 9th digit on the phones, how can I solve the problem of displaying phones that have 8 digits?

This was a question that came up with the ninth digit news on the phones here in Brazil. I have in the system a list of phones that are saved together with the DDD. How can I make an 8-digit phone (and with the DDD) be filled with 9? Ex...
asked by 15.10.2015 / 15:13
5
answers

Sum of hours greater than 24h

I have a variable with the value '18: 00 ', which corresponds to a duration received through two-time calculations. $tempo = '18:00'; // queria somar 8:00 Answer: $temposomado = '2:00'; Desired value: $temposomado = '26:00' How ca...
asked by 20.04.2018 / 18:35
4
answers

Installable PHP application architecture [closed]

I'm trying to improve my PHP applications. In this goal I would like to create an installer for a web application, a website for example. I already know linux packages like rpm and deb, that's not what I'm talking about, because some servers...
asked by 24.12.2013 / 17:40
2
answers

Codeigniter session expiring after an action

I made an administrative panel using CodeIgniter and every time the session expires, thus redirecting to the login screen. Every time, for example, that I edit a category, after editing it and clicking another menu link, the system redire...
asked by 21.11.2015 / 21:00
1
answer

Use of while within another while in PHP

What happens in my PHP code is this: I make a query in the database and with that a DO WHILE (while that query returns records), it displays some information on the screen (based on the query, of course). Until then, all right. However I need no...
asked by 24.11.2015 / 23:57
1
answer

Get autocomplete return and put on different inputs

I have the following script <script type="text/javascript"> $().ready(function() { $("#course").autocomplete("teste1.php", { width: 260, matchContains: true, selectFirst: false...
asked by 03.12.2015 / 17:44
1
answer

Send email using cpanel account and PHPMailer

I'm trying to send an email using my cpanel account and the phpmailler class but I'm not getting success, the code I'm using is the same as the PHPMailler documentation, how should I proceed? , would anyone have a fucnional code to share? Thank...
asked by 13.11.2015 / 17:14
2
answers

Differences in the use of $ this, self, static, and parent

I have a question about the "appropriate" use of $ this , self , static and parent in some specific scenarios. I know the meaning and theoretical use of each: $ this : basically references the instance of the object. Serves for non-s...
asked by 20.10.2017 / 03:44