Posts by Lollipop • 4,918 points
260 posts
-
0
votes4
answers1229
viewsA: Is there any way to display the result of a query(mysqli) in the form of HTML?
I suppose everything is working properly in your Query, then to display the result of the variable $rowcount, on an html page, you can use this form within any file .php between appointments HTML:…
-
1
votes1
answer97
viewsA: Json does not return data to Javascript
Your Content-type header should be: header('Content-Type: application/json'); The header is there so that your app can detect which data has been returned and how it should handle it. In case it…
-
11
votes5
answers860
viewsA: Why is a variable with no value considered uninitiated?
If parameters are passed, then isset will return TRUE, only if all parameters are defined. An uninitiated variable is equivalent to the PHP constant NULL. Hence the function isset will return FALSE.…
-
1
votes1
answer252
viewsA: Problem with validation of various forms with ajax and php
To Jquery 1.5+, you can ultilizar the object: $.when($.ajax(), [...]).then(function(resultado){},[...]); Example: <input type="button" id="button" value="enviar" />…
-
3
votes4
answers290
viewsA: Password and redirection
Put your check to the page you are on. Example: index php.: <!-- Trabalhe sempre com arquivos .php para poder executar as condições--> <form id="formPassword" action="index.php"…
-
2
votes1
answer83
viewsQ: Consult with INNER JOIN and choose the loop reference
Guys, I’m looking at two tables with INNER JOIN thus: if (! $db->Query("select * from cad_produto inner join cad_variacoes on cad_variacoes.id_produto = cad_produto.id")) $db->Kill(); while (!…
-
1
votes1
answer67
viewsA: What codes to use to zoom in on the camera?
This below will work if the user’s Android is: API 8 + Camera.Parameters parameters = camera.getParameters(); int maxZoom = parameters.getMaxZoom(); if (parameters.isZoomSupported()) { if (zoom…
-
0
votes1
answer31
viewsA: How to put a background color on a Shapedrawable?
If you just want to insert a color, this is the shortest way: ShapeDrawable drawable = new ShapeDrawable(); drawable.getPaint().setColor(getResources().getColor(R.color.blue));…
-
0
votes6
answers8471
viewsA: Do not open keyboard automatically when on screen with Edittext
Use these attributes in XML: android:focusable="true" android:focusableInTouchMode="true"
-
1
votes1
answer453
viewsA: Sort events in descending order in Wordpress
See if it helps. Just add the orderby and order: <?php query_posts = ('post_type=event&posts_per_page=3&orderby=date&order=DESC'); ?> Source…
-
0
votes4
answers140
viewsA: How to add class to the first <img src=""> of a set
This was a perfect solution as it makes it easier when a reference div is placed: $('#referencia img:first').addClass('classe');
-
1
votes4
answers140
viewsQ: How to add class to the first <img src=""> of a set
Guys , I have a set of <img src=“”>. I need, once the page is loaded, to add a class to the first of that set with Jquery, but remembering that they have a relative, the href. ... <a…
-
2
votes2
answers115
viewsQ: addClass() is adding class to <a href=""> instead of <img src="">
Guys , I need to put a link in the image and when I did, there is an error in my fade effect done with Jquery. I believe the error lies in the misuse of next(). This fade will only work if the class…
-
1
votes2
answers1630
viewsA: Is there crud plugin for wordpress?
Plugin for Cruds generic within Wordpress is not very necessary, when one has the good use of the global class $wpdb. Create your own plugins manipulating the wpdb Class. However, there are…
-
0
votes2
answers11114
viewsA: Pass parameters via GET and include more parameters
Use the & at the beginning of a new parameter. .... <a href="?sexo=m&cor=verde">Masculino e Verde</a> ....
-
0
votes2
answers1663
viewsA: Youtube video for a video view
This is a specific class, that works, for this type of application. See how it works, in the comments and adapt to your code. Note that there are only 3 lines that make a video run correctly: public…
-
2
votes1
answer459
viewsA: Share Audio File
With the device path you can use: final Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND); shareIntent.setType("audio/3gpp");…
-
1
votes1
answer88
viewsA: How to make the box open without the user pressing the text
Use the event onload, example: ...... <script type="text/javascript"> $(document).ready(function() { $('body').onload(function() { $('startMatter').toggle(); return false; }); });…
-
2
votes1
answer538
viewsA: How do I direct every request to a subfolder? (HTACCESS)
Here’s what I used to redirect to a subdirectory. This happens invisibly and even allows requests that match an existing file: RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?site.com$ RewriteCond…
-
2
votes4
answers2045
viewsA: How to limit PHP words
Simple imprementation by fixed number of characters: $texto= strip_tags($texto); if (strlen($texto) > 500) { // Limitando string $corteTexto= substr($texto, 0, 500); //certifique-se que termina…
-
0
votes2
answers5680
viewsA: How to authenticate a user in an android app that uses Facebook login
THE BASICS FOR AN IMPLEMENTATION: Facebook App - Configure, create a simple login link. Facebook SDK - Set up the SDK to use the api. Facebook App ID - Use your app ID: 1 - Abra…
-
1
votes0
answers208
viewsQ: Mail function sending attachment Noname
The email is successfully sent, but it seems that the attachment is not being sent correctly, because what comes is a file of 0 B, with the title of: Noname. What are the causes for such a problem?…
-
1
votes1
answer104
viewsQ: Limit the amount of items in an Input by default total value
I have a variable with that value: var total = 10; And two input: <input type="text" name="foto-1"> <input type="text" name="foto-2"> I need the customer to be prevented by a value in…
-
1
votes1
answer78
viewsQ: realpath() function does not accept variable
You guys, when I put this on: $rootPath = realpath("/home/687_332_0/332"); echo $rootPath; The above example will print: 687_332_0/332 (WORKS!) However, when I put what’s below, echo does not work:…
-
0
votes1
answer1394
viewsQ: How to get the number of images in a folder with Javascript/Jquery
I tried to use this function: function getCount(foldername) { var myObject, f, filesCount; myObject = new ActiveXObject("Scripting.FileSystemObject"); f = myObject.GetFolder(foldername); filesCount…
-
1
votes3
answers1490
viewsA: Changing the modal content
I advise using Jquery: 1 - Create an event for each know more being identified by an ID: $('#saiba1').click( function() {.... 2 - Use html() or text() function, depending on the content to add: $(…
-
5
votes3
answers1759
viewsQ: Create post on a wordpress and bring in other wordpress automatically
Options: Create a new POST on a wordpress-1, from another wordpress-2. or Everything that is created in wordpress-2 be "copied" to wordpress-1 or Create/Register a product in a store(site)-1, from…
-
3
votes2
answers430
viewsQ: How to ZIP only images from a folder with PHP?
Guys, in my folder being zipped, there are files .php and images, but I need to zip only the images! Is there any possibility with the class ZipArchive of PHP? My job (works perfectly for everything…
-
2
votes1
answer407
viewsQ: How to pass a GET request to a file that does not belong to wordpress
wordpress does not recognize files that do not belong to it, even though it is there in the theme folder, which is my case. How can a make an external file receive this information? For example: I’m…
-
1
votes0
answers471
viewsQ: Customize product attributes in Woocommerce
Currently, as far as I know, the attributes are created in the product edition in "Product Data" on Woocommerce. When entering the Attribute Value: 30 | 60 | 90 | A drop-down at the front. However,…
-
13
votes6
answers4694
viewsQ: How to make a stopwatch continue counting after closing the page?
I need to create a stopwatch that is started through a play, but wanted a solution, other than by SESSION, to let you count even if the customer closes the window or drops his internet, ie that is…
-
0
votes1
answer105
viewsA: Error 500 move_uploaded_file
Check that your web server has write permissions in the "/product directory"
-
1
votes3
answers5147
viewsA: Angularjs vs Jquery input mask
I advise doing something "manually", javascript: <html> <head> <script type="text/javascript"> function mask(inputName, mask, evt) { try { var text =…
-
3
votes3
answers6109
viewsA: Undefined Index while recovering data from POST
Notice: "Undefined index": To understand this type of message, note the example below: $x = $y + 10; Running this script, which value should contain the $x variable? You must answer, impossible to…
-
0
votes1
answer2505
viewsQ: Dynamically populate input with angular
Friends, help me make a script in which I can add words to an input as a button is clicked. The words should stand side by side and separated by comma: word1, word2, word3 This gives me an input, as…
-
2
votes1
answer324
viewsA: PHP and Wordpress, run a script every time you make a new post
Use this function to return a value booleano: function is_edit_page($new_edit = null){ global $pagenow; //certifique-se de que estamos no backend if (!is_admin()) return false; if($new_edit ==…
-
0
votes4
answers3216
viewsA: How to know if the app is open
You can use a class to check if the app is in the background with ActivityManager.getRunningAppProcesses(). class ChecarSegundoPlano extends AsyncTask<Context, Void, Boolean> { @Override…
-
1
votes1
answer880
viewsA: How to change the content of a spinner by making the selection on another spinner?
Just use the concept of parentesco: The first item of the first spinner is selected, then the data of the second spinner is exchanged. It occurs the same way when the second item is selected.…
-
5
votes1
answer15992
viewsA: Set time to expire $_SESSION
In general, I always use this form. Implementing a session timeout: if (isset($_SESSION['ultima_atividade']) && (time() - $_SESSION['ultima_atividade'] > 3600)) { // última atividade foi…
-
2
votes1
answer800
viewsQ: Jsangular Multiple ng-repeat
I’m having a hard time creating a loop with ng-repeat, at the angle. Next... I wanted to create tags for each projeto that I add, example: See that it is possible add more tags and there is also, in…
-
1
votes1
answer8366
views -
3
votes2
answers4746
viewsA: How to adapt an Android app to various screen sizes?
Use wrap_content and match_parent: To ensure that your layout is flexible and adapts to different screen sizes, you should use "wrap_content" and "match_parent" for the width and height of some…
-
0
votes3
answers188
viewsA: How to share an android photo
You can share a photo as long as there is a path to it. And the URI identifies this path when assigned a value in string. Search the image on your device via the path given in the URI]: Uri…
-
1
votes4
answers174
viewsA: Is it possible to use PHP in a data-title field?
1 - Check if your document is .php 2 - You don’t need to square brackets data-groups='["<?=$row['portfolio_tipo']?>"]' ... <?php $portfolio_tipo = $row['portfolio_tipo']; $portfolio_data =…
-
4
votes3
answers10588
viewsA: Global variable in all functions of the class
Create accessible variable for all functions of a class: <?php class teste { /* construct */ function __construct($variavel) { $this->global_variavel = $variavel; } function checando_funcao()…
-
2
votes1
answer112
viewsA: Switch Case PDO does not display
FetchAll does what it says: it searches all the results for a query. Since the search mounts results, you will get an indexed matrix. You should change all queries for prepared instructions and…
-
1
votes1
answer445
viewsA: Set text in facebook API sharing
You can’t do this using Sharer.php, but you can do something similar using API dialogue. EXAMPLE: APP_ID = Facebook app Identifier "http://www.THEPAGE.com" = This would be my domain…
-
0
votes2
answers3920
viewsA: How to set a value on a Spinners?
Suppose your Spinner is named Myspinner, and it contains as one of your choices: "some bank value". To find and compare the position of "some bank value" in Spinner use this: //Dentro desta variável…
-
2
votes2
answers1050
viewsA: What better and safer way to program PDO?
Best Practice Using Prepared Statements: $id = 5; try { $conn = new PDO('mysql:host=localhost;dbname=meuBancoDeDados', $username, $password); $conn->setAttribute(PDO::ATTR_ERRMODE,…
-
2
votes1
answer926
viewsA: Load data during page scrolling with jQuery
I will show an implementation where the connection nay is via PDO, but it’s about answering your question that’s not about secure connection: TEST Create a table in the database called post CREATE…