Posts by Leno Sousa • 609 points
30 posts
-
-1
votes1
answer109
viewsQ: Json values without double quotes
I have a php/json file in which the numbers coming from an sql query result in double quotes: "relatorio": [ "3", "1", "2" ] I’d like to leave them without the double quotes on the numbers. I’m…
-
1
votes1
answer34
viewsQ: Redeem value from a string in an array
How do I get a string inside an array like the one below: array(2) { ["data"]=> array(1) { ["charges"]=> array(1) { [0]=> array(8) { ["code"]=> int(433528162) ["reference"]=>…
-
0
votes1
answer74
viewsQ: Api payment Boletofácil in php
I’m putting together a pay-as-you-go panel. the system asks me to generate a payment request url:…
-
1
votes1
answer829
viewsQ: Calculate Price in Javascript
I have a table where will be calculated Quantity x Price in javascript. Following the rule of decimals. At the moment I’m using the basic function, but it only works if you put integers or with "."…
javascriptasked Leno Sousa 609 -
1
votes2
answers1769
viewsA: Protect from sql Injection in php
I am not an expert in Protection for SQL Injection, but I will share a code that helped me a lot. function protect( &$str ) { /*** Função para retornar uma string/Array protegidos contra…
-
1
votes1
answer113
viewsQ: Clear Html Tags from an input result, with the exception
How do I remove all html tags from a string with exception? Ex: var exemplo = "<div><p>Leno<span> Sousa</span> <i></i>var exemplo =…
-
1
votes0
answers64
viewsQ: Form in UL List Li
I have a form where the structure is formed by an organized list <ul> <li id="pai"> <input type="text"><button class="ul-appending">Add Input</button> <ul>…
-
1
votes1
answer46
viewsQ: Organize Listing by mysql data parent item in php
I have a list to do that will work as follows: <li id="1">Pai <ul> <li id="2">Item 01</li> <li id="3">Item 02 <ul> <li id="4">Item 03</li> </ul>…
-
3
votes1
answer53
viewsQ: Sum all results of a table and separate by day/month
I have a table where I would like to add all the results and separate them by Day/Month. 01/Abril = 3 Resultados; 03/Abril = 5 Resultados; 02/Maio = 1 Resultado; The table I’m using. **ID --…
-
1
votes1
answer479
viewsQ: How to preview the selected file title via Javascript?
I have a code for image upload preview in Javascript. However I would like to use with document format, so that instead of showing the image that will be loaded, show only the name of the pdf/word…
-
1
votes1
answer455
viewsQ: Dynamically php add/remove inputs
I am creating a form where when filling in, the user will add more fields dynamically, so far I have already, but I would like to separate the value of each field added to send the separate data in…
-
0
votes0
answers38
viewsQ: Multiplus input upload
I’d like to add more input files dynamically. I want to be able to add more images and put a caption for each image. without a limit for uploads.
-
1
votes1
answer393
viewsQ: Error: readdir() expects Parameter 1 to be Resource, Boolean Given
How do I return an empty value in the command opendir($dir); in php? I would like that when there is no folder, return with zero value, because it is giving error: readdir() expects Parameter 1 to…
phpasked Leno Sousa 609 -
0
votes1
answer624
viewsQ: Upload in Submit form AJAX
I have a form where I send data through AJAX jQuery. However, I would also like to send a file. How do I add to my code? var formData = { 'titulo': $('input[name=titulo]').val(), 'tipo' :…
-
0
votes1
answer54
viewsQ: Format last different Select Mysql result
I need to put the last result with a different format. as in a mysql table, for example. <a class="registro">Valor 1</a> <a class="registro">Valor 2</a> <a…
-
0
votes2
answers1096
viewsQ: UTF8 on Mysql PHP connection
I have a PHP PDO connection with two databases, however, I’m having problems with the special characters of both. How to solve? $host = "localhost"; $user = "user"; $password = ""; $database1 =…
-
2
votes2
answers13385
viewsQ: Android Studio - non-ASCII Characters
I bought a project for android studio. when opening appears the following error. Error:(14, 0) Your project path contains non-ASCII characters. This will Most likely cause the build to fail on…
-
0
votes1
answer337
viewsQ: List two mysql Pdo tables
$catalog = $dbh->prepare("SELECT * FROM catalogo WHERE ativo = 2 ORDER BY catalogo_view DESC LIMIT 0,5"); $catalog->execute(); I want to search between two tables, as I do?…
-
11
votes1
answer28766
viewsQ: List files from a PHP folder / directory of certain extensions
I need to list the files of a folder, and display them by name linked to his directory for download. I use that code: $pasta = 'uploads/'; $arquivos = glob("$pasta{*.jpg,*.JPG,*.png,*.gif,*.bmp}",…
-
1
votes2
answers17302
viewsQ: Add more fields in form dynamically in Jquery
I am creating a form, in which the user will add more fields dynamically. I took the function of this tutorial: http://www.sanwebe.com/2013/03/addremove-input-fields-dynamically-with-jquery The…
-
0
votes1
answer131
viewsQ: Facebook SDK login Popup
I have a plugin login by facebook, I took this tutorial http://www.krizna.com/general/login-with-facebook-using-php/. so far so good, but I would like to put it to redirect to the same page on which…
-
2
votes1
answer66
viewsQ: Block existing email in jquery.validate
I have a registration form that uses the jquery.validate.js plugin http://jqueryvalidation.org. I searched but couldn’t find a way to return an error when the client inserts an already valid email.…
-
1
votes0
answers63
viewsQ: New Position in Opencart 2x Template
How do I insert a new "Position" into my template? I have knowledge in Programming, but I don’t know exactly the structures of an Opencart template. someone can help me?
opencartasked Leno Sousa 609 -
1
votes1
answer293
viewsQ: Return the previous page after logging into facebook oauth
Use the standard Facebook login system, it asks to enter App ID the App Secret and the URL that will return after requesting the login to the user, my question is, how to return the url where the…
-
2
votes2
answers4562
viewsQ: Count number of files in folder
I am creating a listing of images contained inside a folder, but I would like to count the amount of files inside the folder, how do I? Below is the code I’m using: <?php $pasta = 'imagens/';…
phpasked Leno Sousa 609 -
1
votes3
answers789
viewsQ: Exception in sql query
How do I view my Mysql database items in php, so that you select all items except one item. Ex: I have several records... item 1 | id01 item 2 | id02 item 3 | id03 item 4 | id04 item 5 | id05 item 6…
-
1
votes1
answer19
viewsQ: Message in Google Webmasters Tools - Changes to sitelinks for http://meusite.com.br
Someone knows what this message means in Google Webmasters Tools, I’m receiving it direct. All I know is it’s something to do with Sitelinks, I believe it’s some fault or error. A verified user has…
-
-2
votes4
answers2204
viewsQ: Multiple items in a Mysql column
How do I insert and display separate data in a single Mysql mo column? Ex: I have a column (catalogo_address), in it I want to insert the street, the city, and the state in one column and then be…
-
7
votes3
answers13303
viewsQ: Star voting with radio input, javascript/css
I am creating a registration form, in it I will insert a voting system, I wanted to do that when clicking on some star, the previous ones will change color too. (Follows the code I created) <div…
-
3
votes2
answers4434
viewsQ: Adding numbers from a Mysql column using PHP
I have several results in the Mysql database, I want to take the results and sum all the numbers in a column, in PHP. How do I?