Posts by Luiz Alfredo Galiza • 457 points
10 posts
-
0
votes2
answers886
viewsA: pointer casting
The casting of a pointer to (void*) is necessary for some functions that use a "generic pointer" as an argument. A pointer, in addition to pointing out an address of a variable, also stores the size…
-
0
votes7
answers11400
viewsA: How to validate phone in php
Use this code that uses preg_match to validate and preg_replace to fix. $validacao = "^\(?(\d{2})\)?\b+(\d{5})\-?(\d{4})$"; if (preg_match($validacao, $telefone)){ $telefone =…
-
-1
votes1
answer1043
viewsA: Problems when passing ID to MODAL window
In the main archive: <button onclick="$('#modal-container').load('modal.php?id=1', function(){$('#modal').modal('show');})">Abrir modal com id = 1</button> <button…
-
0
votes3
answers3264
viewsA: Show or Hide Input According to Selected Radio Button
Use the pj and pf classes in the fields to be displayed and hidden. $( document ).ready(function() { $("input.pf, input.pj").hide(); $("#id-custom_field-account-1-1").click(function(){ if…
-
0
votes2
answers670
viewsA: GRID Bootstrap column size - Customized value
The values of bootstrap column widths are defined in terms of percentage, as well as being responsive. If col-Md-1 has gotten too small, it’s probably your visualization that’s small. To improve…
-
0
votes2
answers2451
viewsA: Save the result of select in a variable and use this variable to fill the input that will then be used to do an UPDATE in the same table
Go to the edit page with a GET parameter, id=X to open an edit form: <?php if (isset($_POST)){ $sql = "UPDATE tabela SET telefone = '{$_POST['telefone']}' WHERE id = '{$_GET['id']}'";…
-
0
votes2
answers141
viewsA: How to rescue html text from database?
Write to the bank: $texto = addslashes($_POST['texto'); Bank read: $texto = stripslashes($linha['texto']); echo $texto;
-
33
votes3
answers57155
viewsA: Charset iso-8859-1 and utf-8 compatibilization problems
An excellent tip for not having problems with charset is to always use the same encoding for: Apache (httpd.conf or . htaccess file: DefaultCharset UTF-8) Database ( mysql_set_charset("utf8") ) HTML…
-
0
votes1
answer119
viewsA: Doubt with use of`pthread` in Posix
The code seems correct. The pthread_create function starts the thread execution without locking, that is, the thread runs without interrupting the main stream. Finally, the pthread_join function…
-
2
votes4
answers63
viewsA: Positioning of li’s on the page
If you know the exact number of <li>'s then use the code below, adjusting the percentage to match the 100%: <style> li { display: inline-block; width: 20%; float: left; } </style>…