Posts by Gabriel Rodrigues • 15,969 points
440 posts
-
0
votes3
answers496
viewsA: List json object returned by php
You can use the each to go through the json and insert the values in the fields you want example: var json = { "resposta": [ { "titulo": "A TERRA", "outroTitulo": "DIA DA TERRA" } ] } // exemplo de…
-
1
votes2
answers2851
viewsA: Check if user closed browser
Currently I did not find any elegant way to check when the user closes the browser to open the possibility of another connection, so I use another methodology to solve this problem, let’s see. 1°…
-
1
votes3
answers688
viewsA: Hide JSON element using javascript
and only use as an example object: var json = { "name": "test", "count": 5, "frequency": "Manual Crawl", "version": 1, "newdata": true, "lastrunstatus": "success", "thisversionstatus": "success",…
-
0
votes2
answers920
viewsA: Problem with PHP login/logout
I rewrote your code using PDO class for connection, See why to use PDO first step function log: function logar($nome, $senha) { $pdo = connect(); $senha = md5($senha); $sql =…
-
3
votes2
answers79
viewsQ: How to Create a Slide Side Out Submenu
As I can add a submenu to an existing menu, example I have the menu Ensino inside teaching want to put Cursos,Intercambio and iniciação cientifica, I’m using a class called SWRevealViewController…
-
2
votes3
answers10359
viewsA: Access only via login and password, Inhibiting direct access via url
If when logging in you start the session by placing $_SESSION['logado'] = 1 suffice you put in a file funcoes.php where their pages call them, and perform a function for example: function…
-
2
votes1
answer642
viewsA: Error "trying to get Property of non-object" when using ipinfo.io
@Bruno Gibellino, this script takes details of ip,city,region,country, location that can be used to find you on google maps for example. Take a test, put a echo before the ip and also in the…
phpanswered Gabriel Rodrigues 15,969 -
1
votes2
answers3938
viewsA: Calculation with decimal number PHP
If you will work with calculations often advise using a function that can format these values. Example: function valor_func($aValor, $aTipo, $a_dec = 2) { // valores com mascara e sem mascara switch…
phpanswered Gabriel Rodrigues 15,969 -
8
votes3
answers311
viewsQ: How to use a different logo if the pattern does not exist?
I would like to know if there is a solution to the following problem, if there is a logo_enterprise image to consider it and apply it to css, if there is no logo_default, that way I could control…
-
4
votes1
answer2229
viewsQ: How to get the value of several fields filled using jQuery?
Currently I have a customer search system that can be searched by Cpf, cnpj, phone, address, email and various other information, I can search a customer asking if there is a customer possessing an…
jqueryasked Gabriel Rodrigues 15,969 -
11
votes2
answers1324
viewsQ: How to use Template in C++?
I’m learning a little about template and made an example, but when I went to apply to my project I couldn’t, let’s go to the following test: #include <iostream> using namespace std; template…
-
1
votes2
answers171
viewsA: Change menu class
in a simpler way, just put in the event of the click or any other you want to remove all classes active of ul and just put in the this current which is exactly where you clicked, see an example :…
jqueryanswered Gabriel Rodrigues 15,969 -
1
votes2
answers1985
viewsA: Dynamic data display with PHP
It’s quite simple to actually work with the combination of html,ajax and php to make requests, see the example below: 1 thing to do is to put a field inside the modal where you will receive this…
-
5
votes6
answers2483
viewsA: Why is Drag-and-Drop programming rarely used?
I had the same doubt and after a while I realized I need to ask three basic questions to decide whether I should use Drag-and-Drop or not. 1 - I know how this code works ? When you know how the…
-
3
votes1
answer4464
viewsQ: Remove item from simply chained list
I’m having trouble removing an item by the value of a simply chained list. I’m doing so: class No{ public: int dado; No *next; No(int item, No *ptr= NULL){ dado=item; next=ptr; } }; class Lista{…
-
1
votes2
answers945
viewsA: Bootstrap grid for form
To ensure that it is responsive and occupies the ideal size just use row within a <div> and within this div you use up grid system 12 columns. example: <div class="row"> <div…
-
2
votes1
answer727
viewsQ: What is the difference of implementing classes in C++ and PHP?
I am currently working in PHP and realized that when implementing classes I can’t just instantiate and then implement below the class using the scope selector ::. Example: class Lista{ public:…
-
3
votes1
answer859
viewsQ: How to use friendly Urls?
I currently use the MVC in my project and when I access my system it shows a url like this: http://localhost/view/html/cliente.html what I would like to get is: localhost/cliente because it’s the…
-
1
votes3
answers2379
viewsA: How to see how much memory occupies such a variable in C++? And how to use the define?
define it works like this: #define TAMMAX 100 first comes the defines then the name and what it contains in that name, when the compilation is done all that is with the name TAMMAX in its code and…
-
1
votes2
answers1692
viewsA: Xampp with Mysql Problem
Modify the doors on httpd.conf to stop the conflict between doors. Look for: ServerName localhost:80 Change to: ServerName localhost:81 Look for: Listen 80 Change to: Listen 81 After this restart…
-
0
votes2
answers2313
viewsA: Login and password with permission level in php
mysql_connect no longer works and should be replaced by PDO mode. We should not use this function anymore, for the simple fact of the PHP have more sophisticated and more secure methods. in addition…
-
4
votes4
answers172
viewsA: Rewriting vs Incremental Improvement?
I work at a billing software company that uses software written around 2004 and I’m developing the new version. Companies need to know real information and experiences of other companies about how…
-
5
votes3
answers8270
viewsQ: Convert natural number to binary recursively
How can I turn this function into a recursive function? I managed to make it iterative in this way: #include <iostream> using namespace std; int main (){ int n,pot,bin; cout << endl…
-
2
votes2
answers147
viewsA: Reset jQuery events when sending a message to the user
Another good way to do it, instead of creating the dynamic div inside the msg, put #msg as the divria itself, hide it and just show it in the click. i preferred to do by css:None display, but you…
jqueryanswered Gabriel Rodrigues 15,969 -
0
votes2
answers1783
viewsA: Dropdown with navbar bootstrap images
Exemplifying font-awesome+css: JSFIDDLE To add new icons: example: <i class="fa fa-{NOMEDOICONE}"></i> Documentation font-awesome…
-
0
votes3
answers1561
viewsA: Increment letters in PHP?
It is normal to do this way, if I were to need a solution so I would do this way: foreach (range('a', 'z') as $letra) { print $letra; }
-
0
votes2
answers938
viewsA: Insert the json return inside Divs separated by <div> </div>
Create a id for each append that for certain, for example: HTML <div id='imagem'> Mostra a imagem </div> <div id='title'> Mostra o titulo </div> <div id='descricao'>…
-
2
votes5
answers17262
viewsA: How to use ajax and php to call a function in php?
Depending on the size of your system and the number of functions you have on it you will need to use a more organized way to work with Ajax/Php running functions, here are some tips: Create your…
-
1
votes1
answer1435
viewsQ: Boostrap datepicker close-on-click event
Using jQueryUI datepicker by default the date click event and the datepicker close works. How can I do it on bootstrap datepicker ? JS: $('#data').datepicker({ format: 'dd/mm/yyyy', language:…
-
5
votes1
answer1921
viewsQ: How to Convert RTF to HTML
I’m working on a web system that pulls a bulletin board from a system made in Delphi, which uses the format RTF to format the text. With this I need to use some Server-Side class in PHP to transform…
-
14
votes2
answers16859
viewsQ: How can I get the lottery results?
I searched for lottery API’s to get the results of the contests, unfortunately I could not find any. The response of @fpg1503 can read only the result of the current game, I wonder if it is possible…
-
9
votes2
answers3250
viewsQ: How can I purchase HTTPS in my web application?
In this link I learned how HTTPS works: Stackoverflow - How HTTPS works But I don’t know what applications I should use, and how to acquire HTTPS, depends on any host, programming language etc. To…
-
1
votes5
answers29209
viewsA: Reset to input fields after Ubmit with Jquery
You can use the native Javascript method reset() to reset the entire form to its default state. Example: $("#myForm')[0].reset(); Note: This cannot reset certain fields, such as type = "Hidden".…
-
2
votes8
answers13920
viewsA: Is <br> or <br/> or <br />right?
From the point of view of the W3C <br> only. http://www.w3.org/wiki/HTML/Elements/br
-
1
votes1
answer391
viewsA: php mail() function is not working
@Alisson, I managed to solve this problem with phpmailer class, it allows and very simple to use and only needs php5+. here is an example of how to use:…
-
3
votes4
answers4731
viewsA: How to check if the first four characters of a string match 'www.'?
What @Qmechanic73 said is correct, although its code seems a little more extensive it and faster than the others, just a simple tip to improve a little performance, use === instead of ==. See the…
-
0
votes1
answer803
viewsA: Phpmailer Internal Server error
I was using phpmailer recently and suffered the same problem as yours, I have two tips to pass you: 1° check that the openssl php module is enabled, phpmailer needs it 2° if it is…
-
4
votes2
answers2082
viewsQ: How to improve the process of generating unrepeated random numbers?
I have a randomized number creation algorithm for lotteries that have the following characteristics: 1° The number to be generated must be reported. 2° Numbers cannot be repeated. 3° Numbers need to…
phpasked Gabriel Rodrigues 15,969 -
4
votes1
answer8622
viewsQ: How do I get in the Input file?
I need to send several attachments via Phpmailer and am using jQuery to get the value of input file, now I need to pick up the file path to be able to send by email, but when I take the path it…
-
1
votes1
answer681
viewsQ: How to change the src of a <script> using jQuery
How can I change the value of the attribute href of a <link> and of src of a <script>. Real problem, I have two screens that are at different levels (different folders), where both are…