Posts by Ricardo • 14,521 points
350 posts
-
1
votes2
answers2182
viewsA: Repeated elements in a matrix
Solution given in similar question on another web site (Soen) Finding repeats in a 2D array /* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import…
-
2
votes2
answers4468
viewsA: Favicon does not appear
You should use the following line to insert a favicon: <link rel="icon" href="../../images/favicon/image-32.png" sizes="32x32"/>
-
0
votes2
answers445
viewsA: Contact form does not validate and does not send some fields
Try using a strip_tags to remove any possible tag HTML that may have come together: $phone = (trim(strip_tags($_POST['phone'])));
-
10
votes1
answer1417
viewsQ: Protect automated access web pages
How can I protect my web pages so that they are not accessed in an automated way? By search bots Engines like Googlebot (I think the basic form was the metatag with noindex and nofollow). By…
-
0
votes3
answers13476
viewsA: How to feed an input with a get variable in php
Extending member Sergio’s response, this is the basic cleaning performed with values from user inserts, later you must pass the values through validation chains (using if for example). $email =…
-
1
votes1
answer212
viewsA: How to handle query results with PHP OO?
Simple form while($row = mysql_fetch_assoc($retorno)){ echo '<img src="img/'.$row ['imagem'].'" class="img-slide">'; } Using Template in this case Dwoo you create a template dwoo <html>…
-
0
votes3
answers1805
viewsA: Return the inverse of a vector
If you can use the external library Commons-lang only one call to a method is necessary: ArrayUtils.reverse(array);…
-
1
votes1
answer127
viewsA: Crawler for when http_status_code is different from 200
As stated in the comment it was only necessary to insert a conditional with the condition of the desired status_code so that it works perfectly. function handleDocumentInfo($DocInfo){ if…
-
11
votes1
answer8418
viewsQ: What does this anti-roboe code in Javascript do?
What this anti-roboe code in Javascript does? <html><head></head><body onload="challenge();"> <script> eval(function(p,a,c,k,e,r){e=function(c){return…
-
1
votes2
answers672
viewsA: PHP include problem with characters
Open the files in Notepad++ and go to the Format menu button and select the option: Encoding in UTF-8 (without BOM), see that during this process there may be a character change in the file. php…
-
3
votes1
answer299
views -
2
votes3
answers776
views -
2
votes4
answers7944
viewsA: How to take print (screenshot) from a web page?
I already make use of the Headless Browser Phantomjs to download COMPLETE WEB pages FAITHFULLY rendered to displayed in the common browser (it interprets JS and CSS) but with it it is also possible…
-
1
votes3
answers161
viewsA: What is the difference between these 2 PHP codes?
The first code works as follows: You got a class ClasseTeste with 4 protected attributes, attributes referring to access to a database and public function that when called prints the attribute…
-
2
votes1
answer183
viewsA: Learn ABC in C language?
Perform the scanf of the letter, and delete the counter for. #include <stdio.h> #include <stdlib.h> int main() { char c; char limit; scanf("%c", &c); if(c >= 65 && c <=…
-
3
votes5
answers6496
viewsA: Does not record records in my database
This SQL query is wrong, you did not specify to which columns you are inserting which value is very likely to be inserted value of one column in another and giving a type error, it is also not with…
-
6
votes4
answers827
views -
0
votes2
answers128
viewsA: Empty page when running sql command
Not missing something like: printf("%d Row inserted.\n", $stmt->affected_rows); See the official documentation: Documentation…
-
11
votes3
answers1203
viewsA: Why do parameterized SQL queries (name = ?) prevent SQL Injection?
Following what said in a similar question in Soen, queries and with Prepared statements are sent to the database separately from the data so it is not possible to have two SQL queries (SQL…
-
8
votes4
answers15034
viewsA: Difference between mysql_connect() and mysqli_connect() functions in PHP
This is the latest and most recommended, the mysql_connect is discontinued, with the mysqli_connect the newest and uses object orientation, Prepared statements, supports multiple statements,…
-
4
votes3
answers852
viewsA: Function does not return value
This function returns only the last vector value. for is will be assigning until the end of the vector, and when it arrives will return the last value assigned to $c function teste(){ for($i = 0; $i…
-
1
votes2
answers71
viewsA: I can’t access my database
Your connection is incomplete, see the example of W3schools: $con=mysqli_connect("localhost","my_user","my_password","my_db"); You should use quotes to search for datas and strings in the BD:…
-
0
votes3
answers182
viewsA: Is there any way to put Input automatically?
I answered the question before the questioner specified all the permitted languages, but this answer can be used as a subsidy (the idea is literally the same only changes the language) to construct…
-
2
votes1
answer532
viewsA: How do I apply CSS to my form?
To have a placeholder next to the input field: <div class="input-group"> <span class="input-group-addon" id="basic-addon1">Nome</span> <input type="text" class="form-control"…
-
3
votes5
answers838
viewsA: Is it possible to integrate GIT with some task manager?
It is possible to integrate JIRA (free to open-source project) with Git, see explanation links provided by the developer itself: Link It is possible to manage tasks in the bitbucket itself (similar…
-
5
votes3
answers23448
viewsA: Footer "glued" at the bottom of the page and responsive (variable height - using bootstrap)
@Vico if you want the navbar to be stuck at the bottom of this page HTML bootstrap may help you (Derived from a question equal to your Soen): <footer> <div class="navbar navbar-inverse…
-
1
votes1
answer171
viewsA: Error in Eclipse execution
You must install the JDKavailable java here stay tuned on the architecture (x86, x64), it should be the same as your sistema operacional and equal to that of eclipse, this installation will…
-
12
votes1
answer20870
viewsA: What does compiling mean?
What is the compilation process? Compilation is the act / process of translating a program done in a high-level language into a machine language, so that its instructions are executed by the…
-
19
votes2
answers684
viewsA: What is an algorithm?
An algorithm is nothing more than a recipe (like movie script, cake recipe) that shows step by step the procedures necessary for solving a task. He doesn’t answer the question what to do?, but yes…
-
2
votes2
answers520
viewsA: Releasing PHP memory using __destruct
__destruct is automatically called at the end of the script as stated in the script itself documentation Destrutores são chamados durante o encerramento do script tendo os cabeçalhos HTTP enviados.…
-
1
votes1
answer354
viewsA: Change a Select mysql to a Select PDO
<?php $conn= new PDO("mysql:host=localhost;dbname=site", "root", ""); $count = "SELECT * FROM font"; $stmt = $conn->prepare($count); $stmt->execute(); $result =…
-
-1
votes3
answers557
viewsA: Unsigned int doesn’t work?
Probably the compiler is removing the sign and assigning only the value 1the variable, make a printf of this variable to test. when print with %u will be disregarded the bit that represents that the…
-
0
votes1
answer60
viewsA: Problems with . load accentuation
Open the files in Notepad++ and go to the menu button formatar and select the option: Codificação em UTF-8 (sem BOM)
-
3
votes2
answers2102
views -
1
votes2
answers372
viewsA: Problem with PDO and mysql_query connection
Create a connection: $conn= new PDO("mysql:host=HOST;dbname=NOMEDOBD", "USUARIO", "SENHA"); Create a statement: $count = 'SELECT COUNT(*) FROM livro'; $stmt = $conn->prepare($count); and execute…
-
0
votes1
answer38
viewsA: Receiving the wrong header time
Try this, you will get the X/Y coordinates from the left/top point: img = document.getElementById('box'); imagemTopRightX = img.offsetLeft; imagemTopRightY = img.offsetTop; alert(imagemTopRightX);…
-
0
votes1
answer382
viewsQ: Somatório Multithead
I am trying to make a multithread sum but the value is very discrepant: the value that should be the sum of all numbers 499500 what is being the result: 1561250 Main Class: import…
-
-1
votes1
answer175
views -
4
votes3
answers11888
viewsA: PHP code opens in browser
If it is showing the code written in the . php file it is possible that: You have not placed the project inside a specific folder where it is accessible to the localhost. has placed in this location…
-
0
votes1
answer832
viewsA: Responsive column
So that the content of your site you use bootstrap occupy the entire width of the browser change class=container for class=container-fluid. You put only one col for sidebar and 3 to content, will be…
-
1
votes1
answer353
viewsA: Ajax Status == 0
What might be going on: Cross-site scripting CORS (you are trying to access a URL from different from the application) The URL may be inaccessible. You may be using the wrong protocol, many times we…
-
1
votes3
answers4198
viewsA: Align image with text
Put a style="float:left" in the image. If you want a larger spacing between image and text put a padding in this style (remembering that it should be in a separate css, I did it in the tag itself to…
-
1
votes1
answer410
viewsA: Identify selected checkbox
$('#list :checkbox').change(function(){ $('#list :checkbox').each(function(){ if($(this).is(':checked')){ /** *Faz o que desejar quando o checkbox estiver marcado */ } }); }); What he does: whenever…
-
4
votes8
answers2700
viewsA: Is it good practice to mix Php and Html?
This is not good practice to mix the controller (system logic) with the view (visual part of the program that interacts with the user), to avoid the problems caused by this mixture and gain more…
-
0
votes2
answers695
viewsQ: SQL does not return all results that should return
I have the following tables in my bank: and wish to select all products of a particular site (this site is marked by the user through a checkbox) with the following sql: SELECT Eletrodomestico FROM…
-
3
votes3
answers5382
viewsA: capture information from websites
There are several alternatives to search for content from a site: Parsing the site: It will literally download the HTML and you can check the DOM elements of the page. PHP library for this purpose:…
-
4
votes2
answers91
viewsA: PHP reads two Txts files differently
@In addition, open the three files in the Notepad++ (2 txt and the .php file) and go to the menu button formatar and select the option: Codificação em UTF-8 (sem BOM)…
-
1
votes2
answers642
viewsA: I cannot display my database information on the page
Two problems with the vehicle: Absence of $. If it is displaying the source code then it is not running, check if it is accessing using localhost (right) or file:\\\ (wrong).…
-
15
votes1
answer7582
viewsQ: What is the advantage of using CHAR instead of VARCHAR?
What is the advantage of using CHAR instead of VARCHAR in database since the advantages of VARCHAR exceed those of CHAR (if it has? ). There is time difference of field size definition since VARCHAR…
-
3
votes3
answers124
views