Posts by Thiago • 417 points
17 posts
-
2
votes0
answers68
viewsQ: Incorrect use of function or poorly implemented logic?
I am developing an application for lotteries and wrote a function for unfolding tens. She gets a array() containing N tens and unfolds in all possible combinations. For example, for the array:…
-
1
votes3
answers447
viewsQ: Comparison operator or isset()?
I’m developing an application for lotteries, where every generated game goes through N filters before the numbers are shown. Dozens are chosen, passed through via $_POST for a php file that will do…
-
1
votes0
answers43
viewsQ: My function is not getting the expected return
I have the following function: function qa($array = array()) { $a = $array; $sequencias = []; $ultima_seq = 0; for ($i = 0; $i < count($a)-1; ++$i) { if (($a[$i+1]-$a[$i]) == 1) { if…
-
5
votes1
answer484
viewsQ: Is PHP considered open source?
Is PHP considered open source? If so, are there repositories such as Chromium where we can see their "guts" and/or collaborate on their development? If not, does it owe some right to the languages…
-
0
votes2
answers239
viewsQ: How to transform data from a textarea into an ordered array?
I have a textarea that takes data like the following (example): 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 01 02 03 04 05…
-
2
votes2
answers764
viewsQ: Count sequence and number distance in an array
I have an array and with it I need to count sequence and distance among the numbers. $a = array(1, 2, 4, 6, 8, 9, 10, 15, 16, 17, 20, 21, 23, 24, 26, 27, 28, 29, 31, 39); Note that there are 6…
-
0
votes2
answers34
viewsQ: Problem in SQL statement
I have a problem with my code SQL. Well, I have this function that is in the class Usuario: public function CS_GetUsuarios($sql_aux = false) { global $objConexao; $strSql = "SELECT U.*, A.*, G.*, (…
-
-1
votes1
answer76
viewsA: PDO data entry, doesn’t it work?
Try it like this: include "../pages/sqlconn.php"; $name = $_POST["name"]; $email = $_POST["email"]; $pass = $_POST["password"]; try { $sql = "INSERT INTO db_user (user_name, user_email, user_pass)…
-
3
votes1
answer251
viewsA: How to align the dropdown menu with the text?
If I understand correctly, try it this way: <div class="form-horizontal"> <div class="form-group"> <label for="ingredientes" class="col-sm-2 control-label">Escolha um…
-
2
votes1
answer70
viewsQ: Return an in_array() true within an SQL result
I have a function within the class UsuarioVisitas: // Retorna o array com os mais visitados public function CS_GetMaisVisitados($sql_aux) { global $objConexao; $strSql = "SELECT cod_usuario,…
-
0
votes2
answers100
viewsA: How to get button value when firing a Shown.bs.modal event
If I understand correctly: $('#myModal').on('shown.bs.modal', function (e) { // Aqui você pode fazer o que quiser com o valor $('#meubotao').val(); })
-
3
votes2
answers1165
viewsA: Block pages via url
From what I understand, you could use his level of access to not access certain types of files. Editing code as you edit the question. verifi_access.php session_start(); function…
-
0
votes0
answers37
viewsQ: unset() being executed within a wrong parole
I have an interesting problem: my unset($_SESSION['x']) is running inside an IF that is not true. See my code: <?php // Codigo do estado $cod_estado = $_GET['s']; // Função da classe Usuario…
-
0
votes2
answers125
viewsQ: POST crashes the script and does not execute the code after form Ubmit
I have a problem at hand. I have a credit card form, where the customer will fill in the data and be submitted to the bank evaluation. However, it should perform some operations before to arrive at…
-
0
votes2
answers213
viewsQ: Function with in_array is not working
I have this function that is not working the in_array as it should function genNumeros($min, $max, $quantity, $qtd, $somamin = false, $somamax = false) { for ($i = 0; $i <= $qtd; $i++) { $numbers…
-
3
votes1
answer332
viewsQ: Find the least-appearing numbers in the records
Personal greetings. I have a sort of table like this: reg num0 num1 num2 num3 num4 num4 1 4 2 5 8 10 15 2 3 7 8 15 20 21 3 14 10 6 21 17 1 4 1 4 8 10 16 7 5 9 3 2 1 8 15 I need to find out what the…
-
3
votes2
answers592
viewsQ: How to build friendly Urls, such as Facebook and Twitter.
I have a question, how can I build links like Facebook and Twitter? For example: http://facebook.com/nome-qualquer. I know that the .htaccess treats the url in a certain way, but the question I’m…