Posts by KaduAmaral • 11,472 points
313 posts
-
2
votes1
answer1561
viewsQ: Upload only with jQuery.ajax and PHP
I wonder if it is possible to upload a file using only $.ajax({...}) unfulfilled Submit of the form and if so, how? Note: I would like to put this script in the event onchange. Note 2: If possible I…
-
21
votes14
answers126839
viewsA: Phone Mask Using jQuery Mask Plugin
You can do it on Blur, I don’t see a better alternative. That is, do the following: $('#fone').mask('(00) 0000-00009'); $('#fone').blur(function(event) { if($(this).val().length == 15){ // Celular…
-
6
votes4
answers3211
viewsA: How to do strstr() in jquery
It is not necessary jQuery for this, only pure javascript, which already contains the function indexOf, example. var str = "Hello world, welcome to the universe."; var n = str.indexOf("welcome"); if…
jqueryanswered KaduAmaral 11,472 -
2
votes2
answers781
viewsA: Group items by a field into different arrays
The main problem with your code is that you are clearing the array each loop. foreach ($resultado as $res) { ... $servico = array(); For this type of logic you must declare the array outside the…
-
2
votes3
answers100
viewsA: Where to Save JS from a Website
I’m pretty sure most of the answers will be based on opinions, and that question can be closed. But... There’s nothing wrong with making that check if($('#MINHA_ID').length>0){ MINHA FUNÇÃO});...…
javascriptanswered KaduAmaral 11,472 -
1
votes2
answers1048
viewsA: How do I change the value of a PHP variable by clicking a link?
You can use $_GET as described in the comments. Mount the link <a href="link-para-pagina.php?id=2">Link</a> After the ? in the link, the variables are declared $_GET, if you want…
phpanswered KaduAmaral 11,472 -
3
votes2
answers185
viewsA: Animation in Site Sections
With a 2 minute search on Google, I found the plugin Scrollmagic. Here are some examples. And here’s the documentation. Functional code /* Containers */ #content-wrapper, #example-wrapper { height:…
jqueryanswered KaduAmaral 11,472 -
1
votes1
answer75
viewsA: Function is not pulling data!
The problem is that you are declaring your variables within the function: function move_patr_seri(Origem, Destino) { var w_Cont_Qtde = 0; var w_Qtde_Peri = 4; var v_patr = new Array(); var w_valor =…
-
7
votes1
answer723
viewsA: json_encode - Invalid JSON
A likely diagnosis may be the type of coding. To fix this, enter the file type header, leave no character type before and after output, make sure your tag <?php is the first thing in the file and…
-
1
votes1
answer89
viewsA: Problem with Twitter Bootstrap
You can do using position:absolute; and positioning the object according to the size. For your model I did as follows: CSS .header-content{ margin-bottom:60px; } .header-photo { text-align: center;…
-
4
votes1
answer345
viewsA: setTimeout does not work well inside loop
You have to multiply the number of setTimeout every call: var chamadas = 0; function doTimeOut (quadrado) { chamadas++; setTimeout(function() {quadrado.style.background="#cdc8b1";}, chamadas*1000);…
javascriptanswered KaduAmaral 11,472 -
4
votes2
answers781
viewsA: How to perform more than one select for only two fields from another table
This is the query of the two tables: SELECT contr.*, -- Todas as colunas da tabela t_cadcontratos client.Snome -- Coluna nome da tabela t_cadclientes FROM t_cadcontratos contr INNER JOIN…
-
2
votes2
answers426
viewsA: str_replace using arrays
Try it like this: $palavras = explode( ' ', $search_term ); $palavrasnegrito = array(); foreach ($palavras as $p) $palavrasnegrito[] = "<strong>{$p}</strong>"; $title =…
-
4
votes2
answers737
viewsA: How to keep query filters sent via $_POST?
Just as @Bacco commented, you can have multiple filters on different tabs, that is, using the same session, you can use the filter via GET, which is very plausible. <?php $filtro = ''; if…
-
3
votes1
answer1021
viewsA: How can I paginate these results?
Roughly, PDO is just a function that will send your instruction SQL to the database Mysql. And paging is done in Mysql, or you can also do it via programming... Here’s a little example: <?php…
-
1
votes2
answers1539
viewsA: load a specific form according to the selected radio button
Create a file for each form, and load the selected: index.html <button class="carregaform" data-form="A">Formulário A</button> <button class="carregaform" data-form="B">Formulário…
-
0
votes3
answers855
viewsA: How to change the selected option in my 'combobox' from a 'li'?
Put the value of options in an attribute of li, and update the value of select with the method val jQuery: Jsfiddle HTML <select name="itens" id="itens"> <option value="1">Gabinete…
-
1
votes5
answers5323
viewsA: How to center a div with position:Fixed?
Can be done using CSS only: Jsfiddle This is the "trick": top:50%; /* Metade da altura da tela */ left:50%; /* Metade da largura da tela */ margin-top:-25px; /* Metade da altura do elemento */…
-
1
votes3
answers1241
viewsA: Slider in jQuery (Nivo Slider) does not work when it is inside a content loaded via Ajax
Place slide instance after ajax loading: <!DOCTYPE html> <head> <!-- Adicione todos os importes necessários --> <script src="js/ideal-image-slider.js"></script>…
-
4
votes4
answers2383
viewsA: More important than important
CSS - Cascading Style Sheets CSS is rendered by hierarchy, that is, the last ones will overlap the previous ones, that is in the example: p {color:red;} p {color:blue;} <p class="cor">Texto…
cssanswered KaduAmaral 11,472 -
2
votes2
answers93
viewsA: Difference between null, Empty, 0 and false picking up the record in the database
So, you just make one IF, or better yet, a ternary condition. <?php $list['Nome_da_coluna'] = ($list['Nome_da_coluna'] == '1' ? 'Sim' : 'Não'); ?> <label><h3 class="h3"><?php…
phpanswered KaduAmaral 11,472 -
1
votes2
answers234
viewsA: How to make this SQL request with this particularity?
You can do it like this: if (isset($_POST['dorm']) && is_array($_POST['dorm']) && count($_POST['dorm']) > 0){ if (in_array('4', $_POST['dorm'])) { $where .= " ( DORMITORIO IN…
-
3
votes1
answer147
viewsA: How do I populate an array with the database entries?
Store in a variable the records taken from the bank and give a echo within the script also, writing it as you did with the HTML. In the listing... $objs = array(); while($w_registro =…
-
14
votes4
answers23882
viewsA: How to create a permissions control system
Creating a permission system First we need the user table: usuarios id - INT AUTO_INCREMENT PRIMARY KEY nome - VARCHAR email - VARCHAR senha - VARCHAR ativo - INT (0 - Inativo / 1 - Ativo) nivel -…
-
2
votes1
answer121
viewsA: Rewrite the code to display expected result?
Your variable has an empty index because you are giving a explode. And there’s no need for that explode. So you can do it like this: # Selecionando o tipo de imóvel if (isset($_POST['tipo'])…
-
2
votes2
answers1709
viewsA: Saving File in Sublime Text 3 in ISO-8859-1
This happens when the file has invalid or "abnormal" characters like β of the German language. If you enable the option "draw_white_space: all", the sublime will show a ball, where there are white…
-
3
votes2
answers218
viewsA: Quit two PHP Foreachs
You can use a variable; $sair = FALSE; foreach ($order->getItemCollection() as $item) { foreach ($order->getFreight()->getPackageCollection() as $packs) { foreach…
-
4
votes2
answers248
viewsA: To do a complex search I would have to use OR to combine all the instructions?
Assembling a filter ATTENTION: Always validate your variables before sending them to the database. Validating the filter If values are standard, use a code instead of a word in search, so you’ll…
-
3
votes1
answer147
viewsA: How to search with . serialize()
My knowledge of JS/jQuery is not so broad, but you can do so Jsfiddle. Basically just scroll through the elements instead of using serialize, and treat the string. Now you have how to do it with…
-
11
votes1
answer2821
viewsA: How to limit the number of pages shown in a pagination?
It’s easy to do that. First set a link limit to be displayed before and after: $lim = 3; Then set the beginning of the display according to the current page and the limit: $inicio = ((($pg - $lim)…
-
4
votes2
answers61
viewsA: property name textarea name="Q1" ate name="Q20" + php
You better do it like this: foreach($resultado as $y){ ?> <label class="fs-field-label fs-anim-upper" for="q[]"><?php echo $y['ipco_descr_item']; ?></label> <textarea…
phpanswered KaduAmaral 11,472 -
1
votes1
answer66
viewsA: INSERT in mysql in another domain
To do this the server where the other database is has to allow external access, so just open a new connection with the credentials of the database you want to perform the INSERT.
-
0
votes2
answers763
viewsA: How to receive JSON values and right after inserting them into the PHP database
You are receiving the data with $_GET, but your form is defined as method"post" (despite being wrong, so I don’t know if it counts). Receive the data with $_POST and arrange the attribute…
phpanswered KaduAmaral 11,472 -
2
votes1
answer2959
viewsA: How the variable passes via $_POST
Sending the data To send a value per POST, via javascript, the easiest way is by using jQuery. Using jQuery $.ajax({ url: 'pagina-para-receber-os-dados.php', type: 'POST', // GET é o padrão…
-
1
votes1
answer108
viewsA: What is the standard method of positioning elements on a page?
The standard method is static, which positions the element in order of appearance. The other methods are: Absolute: Positions the element according to a defined ancestor with the property relative…
-
3
votes4
answers935
viewsA: Step-by-step operation of binary search algorithm
Cool, I think I’ve never heard of it. So I got interested and made a script in PHP to perform this search. I know it is not the answer sought by the author, but I am sharing for future…
-
2
votes1
answer458
viewsA: Offline PHP connection string
Review your connection information. Standard information for Mysql connection Host: localhost or 127.0.0.1 User: root Password: Default password is blank even So your default connection would look…
-
1
votes3
answers616
viewsA: Carousel bootstrap with two items upright
You can use the grid techniques within the items that Carousel works correctly. Example
-
2
votes2
answers1023
viewsA: Collect dropdown menu with Javascript
In your code do like this: Passes as parameter the Event in the click function of li and adds the methods preventDefault and stopPropagation. Example Give an absolute name to the menu: <ul…
-
1
votes2
answers284
viewsA: Scrollbar - Calculate Motion Field
Try to calculate the speed by dividing the screen size by the size of your bar, or something like that. I haven’t identified a lot of problems here, but I’m not so into your project, but I put a…
-
2
votes2
answers1592
viewsA: Load Value in Input
The function load is to load a content (usually some HTML), within a certain element, ie in your case $("#conteudo").load("processa.php"); you are loading the content of processa.php within the…
-
1
votes3
answers1627
viewsA: How do you set zero or null in an SQL query of a date range, for those whose value does not exist?
You can create a PROCEDURE creating a temporary table before executing the query, for example: DELIMITER // CREATE PROCEDURE TempDateTable(data_ini DATE, data_fim DATE) BEGIN DECLARE v_curdate DATE;…
-
0
votes1
answer105
viewsA: Affix does not stop correctly at the footer
There was an error in css, fixed .affix-bottom.{ for .affix-bottom{. Corrected PS.: Sorry for the lack of attention, but I spent all morning fighting with this "silly".…
-
2
votes1
answer105
viewsQ: Affix does not stop correctly at the footer
I’m trying to create an Affix with Bootstrap but I’m having trouble getting it to stop properly in the footer. He bends, and the class .affix-bottom is not applied correctly. When step offset bottom…
-
17
votes1
answer4912
viewsQ: Safely remember user
That question does not refer to password security, or data encryption itself. The question is more logical. I would like to know what’s the safest way to create that scheme "remind me". I was…
-
2
votes4
answers1502
viewsA: How to make a layout ready for all resolutions
There is, and it’s called Responsive Design. Where all layouts are defined for multiple resolutions. And what opened the doors to this design was the media querys. I recommend studying the subject…
css3answered KaduAmaral 11,472 -
4
votes1
answer214
viewsA: Is it currently safe to use font-face instead of Cufon and the like?
Use font-face making one import from the source in your code: /* latin-ext */ @font-face { font-family: 'Lato'; font-style: normal; font-weight: 400; src: local('Lato Regular'),…
-
2
votes3
answers506
viewsA: User way to include new pages on a website without programming
You must work well in the structure of your database to have a legal result, easy implementation and maintenance. Here I am illustrating a simple yet powerful modeling. Just study the modeling well,…
-
13
votes12
answers5446
viewsA: How to remove accent in upload with php?
I don’t like using files that contain special characters, so I always give a "clean" in the names and etc. function clearId($id){ $LetraProibi = Array("…
phpanswered KaduAmaral 11,472 -
-1
votes5
answers3979
viewsA: Footer alignment
You can do what @Marcosperes suggested, or you can create code with jQuery to identify the user screen size and update the minimum height of your page content. In your case you could do more or less…