Posts by Inkeliz • 20,671 points
671 posts
-
1
votes4
answers660
viewsA: Getting PHP variables via Javascript without reloading page
Well, there is a solution, perhaps it can be considered "gambiarrenta", but that will solve, without using any id and without change in PHP! But better than that I will say "how did I detect" such a…
-
1
votes1
answer474
viewsA: AJAX PHP system - When using $("#div"),load("page.php", {foo: bar}); jQuery not found $("#div")
This is because INPUT was inserted later, this is known as a dynamic element in Javascript. Multiple native functions (eg.click) or not (eg.Select2), do not work before the element exists, in fact…
-
3
votes3
answers896
viewsA: HREF pointing to a button
Bacco’s answer must be the solution to the problem, but it is not a HREF. If you really want to go to HREF you can use: <script…
-
1
votes1
answer146
viewsA: Limited Registration Number mysql_fetch_array
There are two ways I can think now: Using exactly what you have: $contador = 0; // Define um contador (para que cada loop +1) $limitador = 20; // Define um limite (fixo) while($dado =…
-
1
votes1
answer378
viewsA: jquery ui autocomplete + php does not work
This problem is because you are always generating a new JSON. You must create a json ARRAY, so you can use it: <?php //... $json = array(); // Cria uma array (para remover erro em algumas versões…
-
2
votes1
answer803
viewsQ: Start/End of Summer Time: problem with date verification of type "greater than"
Every year I have two problems, one when the summer schedule starts and the other when it ends. Anyway, yesterday the clock was delayed by an hour that created a giant problem. The page should allow…
-
2
votes3
answers5353
viewsA: Pick up input value whenever changed
Try to use the .keyup(), this will insert into the link at the time you enter any number. Test it out here: $('#quantity').keyup(function () { // Se não for número muda para nada…
-
1
votes1
answer179
viewsA: Get CS:GO JSON item status
The mentioned item of example is the 310778159_302028390. That way, you should only get the market_hash_name or the market_name instead of name. In this case simply insert: for($i = 0; $i <…
-
1
votes3
answers117
viewsA: Function on the hyperlink
Note: I know absolutely nothing of Angularjs, never read its documentation. The ng-click seems to offer some specific function to Angular, but I do not know if it is relevant and nothing about it…
-
0
votes2
answers73
viewsA: What does this code do? I need a description of how it works
I believe your problem is in foreach($links as $key => $value) { I will organize the code: $links = array( "Apache Server" => "www.apache.org", "Apress" => "www.appress.org", "PHP" =>…
-
1
votes1
answer60
viewsA: How do I receive the value of Variables Separately from PHP?
You can use JSON, it is your friend. Javascript: In Javascript/Jquery you will need to declare some things, first the dataType and then create a loop to read all the data from JSON. $.ajax({ //...…
-
1
votes4
answers1125
viewsA: Create external html pages
I honestly believe that with HTML there is no way, but this is not the end of the world. =) There are two alternatives, but they are not purely HTML: 1. Javascript/Jquery: Among several ways, you…
-
2
votes1
answer616
viewsA: How to do Hover to link and icon at the same time
You can use functions such as li:hover .gly-user {} and li:hover a {}, thus, when the li suffer the hover will modify the chosen class. Take this example: /* SOMENTE PARA DEMOSTRAÇÃO */ html, body,…
-
0
votes2
answers167
viewsA: How do I get the autoincrement id without being registered?
There is a method using the information_schema. The construction of Mysql will be: SELECT AUTO_INCREMENT FROM information_schema.tables WHERE table_name = <NOME DA TABELA> AND table_schema =…
-
0
votes3
answers2083
viewsA: Attach href to a button
You can use a Jquery (or Javascript) to make the link opening standard with the href in button $("button").click(function() { if ($(this).attr("href")) { alert('Irá redirecionar para ' +…
-
6
votes2
answers11133
viewsA: No 'Access-Control-Allow-Origin' header using php
This is because the meusiteaqui.com is not authorizing, there are two solutions: 1. Authorize via Header: You need to add that: <? header("Access-Control-Allow-Origin: *"); //... ?> On the…
-
4
votes1
answer2309
viewsA: How to make multiple checkbox records in the database at once?
The example will be done in Mysqli, if use (as it seems) the PDO will be necessary to make some adaptations, I will add comments with equivalent functions, but I do not guarantee functioning,…
-
2
votes2
answers456
viewsA: Replace for html
I will list two existing errors: 1. Print(): First in this case the print is not correct, just remove. <--php--> $nomeusuario = $_SESSION['nome']; $html = str_replace('#NOMEUSUARIO#',…
-
2
votes1
answer210
viewsA: How to create a simulator using SESSION
Your goal is to simulate the logo change, correct? So I will use Javascript for This will be the modified item: <img width="150" height="auto" src="upload/<? echo $nomeLogo ?>"…
-
0
votes1
answer253
viewsA: PHP Mysql - return of duplicates
Problem: This must occur because the function: if($resultado == 1){ Would be equivalent to that: if($MySQLi->query($sql) == 1){ This will always return true/1 if the query is successfully…
-
1
votes1
answer499
viewsA: This web page has a redirect loop
The loop de redirecionamento is created when a Location of a page generates a new Location. For example: index.php [Location: login.php] -> login.php [Location: index.php] -> index.php…
-
2
votes2
answers747
viewsA: How to find a link within an html file and switch to another link?
To perform the substitution you can use the str_replace or preg_replace. In this case just change to: <?php //... if(preg_match("/arquivo.txt/",$le)){ $conteudo = str_replace("arquivo.txt",…
-
3
votes2
answers2426
viewsA: Get URL ID instead of INDEX
Should change that in the htaccess, for example: Amendments: HTACCESS: /public_html/. htaccess RewriteEngine On RewriteRule ^([0-9]+)/api.php?$ api.php?id=$1$2 [QSA] PHP: /public_html/api.php…
-
2
votes1
answer1207
viewsA: Change variable when selecting another value in select in JS
Use the function of attr. For example: $('#meu_select').change(function(){ $('#various3').attr('href', 'relatorio_gastos_rec.php?param=' + this.value); }); The attr has two functions: .attr('href')…
-
1
votes1
answer501
viewsQ: Best option for single data (IP, Cookies, MAC)
This question may be a little generic, depending on your point of view, but I will try to be as specific as possible. I have a system that adds 1 (+1) in the visits, when accessed. Example: <?php…
-
3
votes3
answers1284
viewsA: Compare accented letters with accented letters
You can use the iconv to return the letter/word without accent. For example, using maçã: <?php setlocale(LC_CTYPE, 'pt_BR'); // Necessário para definir os acentos brasileiros $array =…
-
9
votes2
answers14581
viewsA: PHP CURL issues error "Unable to get local Issuer Certificate"
For the error reported in the comments, the problem is in SSL. There are alternatives, not very recommended to solve (or check if this is the problem). Checking: Appendage: curl_setopt($ch,…
-
0
votes2
answers3956
viewsA: Session time of the user
PHP already has a parameter session.gc_maxlifetime, that can be changed. Edit the PHP.ini: session.gc_maxlifetime = 1800 This will cause the session to expire after 1800 seconds (30 minutes). Check…
-
4
votes1
answer192
viewsQ: Uppercase Roman numerals with ucwords() or ucfirst()
While typing this question I modified some things, which made me able to solve the problem. That’s why I’m creating this "share the knowledge" in case someone has the same problem. Suppose the…
-
5
votes1
answer192
viewsA: Uppercase Roman numerals with ucwords() or ucfirst()
In order to be able to only maintain (or make) the Roman numerals in uppercase I created this, adapting from some researches. Solution: <?php $explodes = explode(' ', strtolower( $fonte['Nome'] )…
-
4
votes2
answers213
viewsQ: Erase everything except the smallest one per day
I have a space problem and there are many useless things being stored, but they are useful during the same day (you will understand). Real problem: There are more than 2 million "lines" and this is…
-
1
votes1
answer1644
viewsA: Save data to a table in the Mysql database using php
You can check if there are values in all inputs and then insert if there is value, so take the order of the letter and have the date/day. I made an EXTREMELY COMMENTED code so I can understand…
-
1
votes2
answers286
viewsA: GET error in PHP paging
There are several methods to solve. Cause: The $urlEndereco is inserting the ?pag=2, when trying to add the new ?pag= he’s doubling. Resolve: Remove the 2 of ?pag=2 and just insert the new number in…
-
1
votes1
answer550
viewsA: Problems with file_get_contents and Domdocument
Warning problem: To fix the problem of Warning you must use the libxml_use_internal_errors(), in fact it will only hide the mistakes of libxml. Use the following: libxml_use_internal_errors(true);…
-
3
votes3
answers23785
viewsA: How to make PHP and Mysql paging?
I’ll summarize a technique I use using the OFFSET mysql. <?php $limite = 15; // Limite por página // Pega página atual, se houver e for válido (maior que zero!) if( isset( $_GET['pagina'] )…
-
2
votes3
answers890
viewsA: Mysql update of Empty columns only
Let’s rephrase your question: I want to keep a data fixed and only change if there is a POST. That’s it? Use something similar to this: <?php // Pega os dados já existentes baseado no ID, que…
-
2
votes3
answers1372
viewsA: How to not allow repeated INSERT by giving Reload on the page?
You can check if these values already exist. For example: <? $libera = $_POST['libera']; if ($libera == "sim"){ // MODIFICAÇÃO $sqlChecar = mysql_query("SELECT id FROM a_finan WHERE id_reserva =…
-
2
votes2
answers1421
viewsA: How to update link without refresh with javascript?
You don’t need to re-load, just change the url with the Jquery you already use. Modify the button for something similar: For Unlike: <a class="unlike" idArtigo=''.$artigo_id.'" idUser =…
-
1
votes2
answers762
viewsA: How to transfer a full array of the form to another PHP file?
There are two ways I know. Using JSON (quoted by @rray): For the form: <? $json = json_encode($array_dos_pagamentos); // Isto ira converter a array em json ?> <input type="hidden"…
-
6
votes1
answer1291
viewsA: How to structure a mysql database from a JSON
Interesting question, because it goes against the hand of most questions, wanting to generate a json or instead of just reading. Well come on: Tables: I will only create a table with columns (id,…
-
1
votes2
answers72
viewsA: Insert multiple checkboxes into the Database
Whatever is not recommended (as it hurts the 1FN). Well, the $_POST['menu'] contains the two information of value 1 and value 2, if both are marked. What you can do to insert both values into the…
-
1
votes2
answers1800
viewsA: How to take to pass the value of an input to the url
The problem is that there is no GET method with the parameter qtde[]. The mistake is: <a class="btn btn-primary btn-xs" name="alterar" href="carrinho.php?alterar=base?qtde="> In single line…
-
1
votes2
answers1200
viewsA: Only get a repeated value in mysql
There are two methods: 1. Would be using DISTINCT SELECT DISTINCT(cargo) FROM tabela 2. It would be using GROUP BY: SELECT cargo FROM tabela GROUP BY cargo Test this clicking here! Both methods have…
-
0
votes1
answer89
viewsA: Domxpath find element with exact name
I was able to find a solution to the problem. Solution: <? //... @$DOM = new DOMDocument; @$DOM->loadHTML($html); @$finder = new DomXPath($DOM);…
-
1
votes1
answer89
viewsQ: Domxpath find element with exact name
I’m having a problem trying to find an element with the exact name. <? //... @$DOM = new DOMDocument; @$DOM->loadHTML($html); @$finder = new DomXPath($DOM);…
-
2
votes1
answer1036
viewsA: How to send messages at time intervals to a batch of emails
It needs several things, I will summarize in topics: Problem 1: Change the PHP.ini: You need to change to prevent PHP from terminating the process for time, this is only for security, because by…
-
4
votes1
answer75
viewsA: How to transform this array into an array of 4 indexes?
This is easy, use the famous explode <?php $array = array('Camaquã,Cavalhada,Cristal,Hípica'); // Possivelmente está assim. $stringAux = rtrim($array['0'],','); // isto irá remover a ultima ","…
-
2
votes7
answers1134
viewsA: Select a file by name in PHP
You say the default is "20160111_ALGUMA_COISA" It means that it would be (date)(some)(thing). You can use this to get each data: <?php $nome = '20160111_ALGUMA_COISA'; //nome $param =…
-
2
votes4
answers82
views -
1
votes1
answer208
viewsQ: Multiple ADD INDEX together or separately?
I wanted to know the practical difference between this, in Mysql: ALTER TABLE `tabela` ADD INDEX `col1` (`col1`); ALTER TABLE `tabela` ADD INDEX `col2` (`col2`); For this: ALTER TABLE `tabela` ADD…