Posts by Leonardo • 9,130 points
332 posts
-
2
votes1
answer735
viewsQ: password_hash or crypt, which brings more security?
I don’t know much about hash and security, I found two functional functions and I couldn’t figure out what the difference would be between them and therefore which is the safest one to save and…
-
3
votes1
answer80
viewsQ: Regex not to escape just < > =?
I currently have the following regex: "/([^\w\.\,]+\s*)/" It escapes, letters, numbers, commas and dots followed or not by space. How do I let it escape everything except the characters: < > =…
-
2
votes1
answer1408
viewsQ: Email with Phpmailer without authentication?
I am using the following code to send email: <?php require 'libs/PHPMailerAutoload.php'; $mailer = new PHPMailer(); $mailer ->isSMTP(); $mailer ->isHTML(true); $mailer->CharSet =…
-
3
votes2
answers1452
viewsQ: How to create an animated Progressbar to inform the strength of the password?
On some sites I’ve seen bars like this, it would be to analyze the security of passwords and size, while the user types the progress bar not only moves, but designs an animation and fill or trim...…
-
1
votes1
answer60
viewsQ: Call class function: Minpdo::connect();
I have a class called MinPDO and within it a function called connect: class MinPDO { public $sgbd = "mysql"; public $dbhost = "localhost"; public $dbname = "minpdo"; public $dbuser = "root"; public…
-
2
votes2
answers1373
viewsQ: Best option to be used in error handling?
I’m creating a library in PHP to make the connection to the database and manipulate data from it, but do not know what is the best option to handle the errors, if it is better to use try/catch,…
-
7
votes2
answers4800
viewsA: Netbeans Project Upload on Github
The team of NetBeans helped me to solve this problem, let’s step by step: Sign into the account of Github. Create a Novo Repositório. When creating you will be given links https or ssh to do the…
-
2
votes2
answers4800
viewsQ: Netbeans Project Upload on Github
I never had experience with Github, I made a simple library of php and wanted to publish it in Git through the IDE NetBeans, I’ve been doing some research, I found something similar, but I couldn’t…
-
0
votes1
answer162
viewsA: PDO bindParam error
The error is found in the use of bind, which is supported only for values and not campos(columns) from the database, so the right code would look like this: First for: for($i = 0; $i <…
-
6
votes1
answer381
viewsA: $_FILES does not work
Tag form: entype="multipart/form-data" EDIT: Probably the target folder of the image (public_html/teste/grid/img) is wrong, you should access it respecting the hierarchy of folders example, your php…
-
0
votes1
answer162
viewsQ: PDO bindParam error
I have a function of UPDATE which takes table, column array, values and Where, I do the treatment: //montar SQL $totalValores = count($valores); //conta quantos valores $expressao = null; for($i =…
-
0
votes1
answer536
viewsQ: Safe way to use PDO?
I’m starting with the class PDO and I have insecurity in working with it, is that I am working in the safest way (when we speak of data security)? I know there are hundreds of parameters on PDO, as…
-
2
votes3
answers966
viewsA: Separate a string in php?
I also managed in a more trivial way looking at the PHP documentation: $str = "senha != over"; // minha string $arr = str_split($str); //tranformo em array $c2 = null; //inicio a variavel caracter2…
-
1
votes3
answers966
viewsQ: Separate a string in php?
I have strings: $str1 = "nome = stack"; $str1 = "id <5"; $str3 = "senha != over"; How do I pick up the string there in the operator or in space (when there is no space followed by the operator it…
-
1
votes1
answer329
viewsQ: Display message instead of error?
I have a BD query function that needs the function conectar which is in another file, in her file I did not give include, I preferred to put the include before calling the function consultar,…
-
2
votes2
answers207
viewsQ: Why do you declare yourself PUBLIC and xmlns using W3.org site?
I have always had this doubt, because most sites declare arguments PUBLIC on the tag !DOCTYPE and xmlns on the tag html and because always the values of these arguments are links to the W3.org? I…
-
2
votes0
answers33
viewsQ: Use @to ignore or if/Else?
In PHP, we use methods POST and GET (besides the REQUEST) to acquire the variables passed by HTML, but we can go through inconvenient situations when redeeming these keys, such as having the display…
-
16
votes2
answers669
viewsQ: What are the advantages of using associative arrays?
I came across the definition of associative arrays which are vectors with indices consisting of strings, example: $site['nome'] = "Stack Overflow"; What are the advantages of using this type of…
-
5
votes2
answers348
viewsQ: Limit the database results?
Continuing with the classroom videos, I came across a method of displaying database data a little different, in the video is used: $result = mysqli_query($conn, 'SELECT * FROM comentarios ORDER BY…
-
2
votes2
answers237
viewsA: Error entering data into database
The error was in the table script, now it looks like this: -- -- Database: `aula` -- -- -------------------------------------------------------- -- -- Estrutura da tabela `comentario` -- CREATE…
-
4
votes2
answers237
viewsQ: Error entering data into database
I’m following the lessons of php, and in the video the guy uses the command mysql, but I know he’s old and insecure and I used the mysqli, however the code does not present error, but does not save…
-
1
votes1
answer5068
viewsA: GET/POST to the same page?
Well, with the link @rray was like this: <?php if(isset($_GET['cor'])) $escolha = $_GET['cor']; else $escolha = 0; if(isset($_GET['concorda'])) $termos = $_GET['concorda']; else $termos = "off";…
-
0
votes1
answer5068
viewsQ: GET/POST to the same page?
Hello, I’m a beginner in PHP and I’m following some videos-lessons, in a we passed parameters via GET or POST (whatever it takes) to the same page of the form, the goal is just to work with radiobox…
-
1
votes0
answers101
viewsQ: Use Admob or similar for Windows Phone [Construct 2]?
I’m using Construct 2 to create games, after Unity gave problem. I want to export mainly to the Microsoft platform (Windows and Windows Phone) but I’m facing a problem when monetizing Windows Phone…
-
1
votes1
answer330
viewsQ: Concatenate string with integer array and write to file?
I have a dynamic vector of integers. For example: 1 2 4 6 8 9 10 I want to attach it to a string, like this, for example: [B]: And record this in a row of the file, then read the file with the…
-
4
votes1
answer1523
viewsQ: Correct use of free() in function?
How to use function free() when it is used within a function, in that function Gero a dynamic vector and the function itself will be the return, example: int* copia(int *vet, int tam) { int i,…
-
3
votes1
answer960
viewsQ: How to separate global functions/variables from the program into files?
I have some files: vetores.c // função main uniao.c // função para unir vetores ordena.c // função para ordenar vetores globais.c // arquivo com variáveis globais I want to know how I reference one…
-
1
votes0
answers51
viewsQ: Visual Studio does not compile for Windows Phone 8
I’m facing a problem with the Visual Studio 2013 Update 4, when trying to build a project for Windows Phone 8, it presents the following error: The"Compilexaml" task failed…
-
1
votes3
answers3226
viewsA: How to identify if user is typing number or characters?
I got here implementing the following method: public bool VerificaString(string str) { char[] c = str.ToCharArray(); char le = ' '; for(int cont = 0; cont < c.Length; cont ++) { le = c[cont];…
-
4
votes3
answers3226
viewsQ: How to identify if user is typing number or characters?
I have a textbox: <TextBox GotFocus="buscador_GotFocus" Tap="buscador_Tap" KeyUp="buscador_KeyUp" TextChanged="buscador_TextChanged" Name="buscador" Grid.Row="0" DataContext="Teste"/> In it…
-
6
votes2
answers5645
viewsQ: Remove special characters and spaces from a string?
I have a problem, in an app I’m picking up the contacts from the phone book, but I want to do a treatment on the numbers of the contacts that can come like this: (99) 9999-9999 9999-9999 9999 9999…
-
1
votes1
answer93
viewsA: Select item in Listbox with Binding?
I got it with the following: private void txtTelefone_Tap(object sender, System.Windows.Input.GestureEventArgs e) { var mySelectedItem = lstContatos.SelectedItem as Contato; num.Text = numero =…
-
1
votes1
answer93
viewsQ: Select item in Listbox with Binding?
I have a contact list: <ListBox Name="lstContatos"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Vertical"> <StackPanel Orientation="Horizontal">…
-
1
votes1
answer66
viewsQ: Grid Usage, Windows Phone C# Silverlight?
Well, I’m having problems developing apps in Visual Studio, my computer is 32 bits, so there’s no way I can test the apps with emulator, and test on my own phone, a 4-inch Lumia. In my last project,…
-
1
votes1
answer414
viewsQ: Queries @media for sites 100% responsive?
Currently I work with three queries always based on the minimum width and maximum width of the screen. The Mobile set from 250px to 480px, the Tablet put as 481px to 1023px and the Desktop put from…
-
-2
votes1
answer333
viewsQ: Responsive site, how to test and set @media?
Well, nowadays every professional website should be responsive, and I doubt that. Initially, is there any offline tool to simulate this? For example: simulate access to multiple resolutions, etc? I…
-
2
votes1
answer571
viewsQ: Put and take whole file?
I have two whole variables a rp and rc, and I have to record them in a file as a way to save their value, and then take them and put them into variables like inteiro to use in my program. To write…
-
0
votes1
answer59
viewsQ: What is the easiest way to make a slide with Bootstrap?
I was following the following tutorial to make a slide: http://getbootstrap.com/javascript/#Carousel The Design I managed to deploy on my page, as it is practically just copy and paste, I followed…
-
0
votes1
answer228
viewsQ: Assign element to matrix only when there is space?
I have some vectors that should be assigned in a 20x20 matrix, but no vectors can override each other and not be printed in different lines, they should be assigned vertically or horizontally. For…
-
4
votes3
answers9903
viewsQ: Get the last N characters from a string
I have a string which in reality is a phone number. But a phone number can have some formats like: +55 34 98989898 34 989898 989898 The constant is that always the last 8 numbers are the phone…
-
1
votes1
answer67
viewsQ: Matrix with dynamic columns?
I have a matrix like this: int numeros[qNum][6]; In reality it stores an integer number per line, separating the digits, for example: I have the number 1234, in the matrix will be: numeros[0][0] =…
-
2
votes1
answer2462
viewsQ: Get size from a character array?
Vector example: char nome[10] = {'b', 'r', 'a', 's', 'i','l'}; First of all, although my vector has 10 position I’m only using six, and I want to know how exactly I picked up this length, which in…
-
2
votes1
answer58
viewsQ: Take element size from a vector?
I have a vector like this: int nums[10] + {1235, 14627, 1625161, 54437}; Always the element will be greater than or equal to 1000, that is, with length equal to 4, and can extend up to 10 digits. I…
-
8
votes2
answers1700
viewsQ: Separating integer by character
I have a vector of integers: int nums[10] = { 1234, 4761814, 9161451, 14357 }; I want to know how to separate these numbers, for example, the first element to turn an array like this: {1, 2, 3, 4}…
-
2
votes1
answer6140
viewsQ: Remove X first elements from a string
I have the following code: copia = num.Text; copia = copia.Substring(cobrar.Length + 1, copia.Length); num.Text = copia; Where copia receives a string from a textbox and cobrar is a predefined…
-
6
votes1
answer310
viewsQ: Search list elements with partial strings
I have a List<string> who receives the phone number of all the contacts on the phone, until there is no problem, but I want to perform some operations with the elements of that list, but I am…
-
1
votes1
answer2691
viewsQ: Search image in HTML code
In a form, I will perform an image search on Bing (in the background) so: titulo.Text = "sou doador" string minhaBusca = titulo.Text + " app"; minhaBusca = "http://www.bing.com/images/search?q=" +…
-
0
votes1
answer32
viewsQ: Create textboxs in a user-determined amount?
In a form the user will be able to choose the amount of images he can put, for each image I must create a texbox to put the URL of each image. He will determine this amount through a NumericUpDown,…
-
1
votes1
answer469
viewsQ: Write to the right line of the file and find parameters present in it?
I created the file: FileInfo arq = new FileInfo("C:\\ProgramData\\dataMinGSMFans"); if (arq.Exists == false) File.Create("C:\\ProgramData\\dataMinGSMFans").Close(); In a form I will see if it has…
-
1
votes1
answer50
viewsQ: Isolatedstoragesetting in Windows Forms?
I’m used to using for Windows Phone, so: using System.IO.IsolatedStorage; public void putString(string key, string variable) { IsolatedStorageSettings iso =…