Posts by Guilherme Nascimento • 98,651 points
2,383 posts
-
3
votes1
answer84
viewsA: Is there any alternative to a giant parole other than by switch case?
If the elements of $inputId represent the array key so use variables like string, variables in php can call functions, see an example: $metodo = array( 'fazMetodo1', 'fazMetodo2', 'fazMetodo3',…
-
1
votes1
answer45
viewsA: Android Studio in Fedora with error: Ignoring Unknown package filter 'Platform-tools'
It seems to me you are trying to install the IDE: https://dl.google.com/dl/android/studio/ide-zips/1.5.1.0/android-studio-ide-141.2456560-linux.zip But not yet installed the SDK, for this first…
-
1
votes2
answers870
viewsA: Problems making an ajax request
The async: false does not work with the .done(), you should use it asynchronously, the async: false will soon be discontinued, as I explained here: /a/117483/3635 Remove this: async: false, cache:…
-
6
votes3
answers2735
viewsA: How to change google’s cache to a redesigned website
If by cache you mean the pages indexed by Google that remain as copies for example: Google does not immediately update or index the pages when you do an update on the site, the most it does is to…
-
4
votes2
answers1158
viewsA: Why does the download attribute not work?
In the Google Chrome it works normally In the Firefox it is necessary that the file in href is from the same origin as the page you are calling. Not supported by any version of Internet Explorer…
html5answered Guilherme Nascimento 98,651 -
6
votes3
answers1419
viewsA: What is the difference in checking an array with isset and array_key_exists?
I gave a brief explanation in this reply /a/63550/3635 I will try to better define here the difference according to the questions asked. Response to: Is there any difference between isset and…
-
19
votes1
answer1783
viewsA: How to read binary file content in Javascript
It depends on the source from where you need to read the file if you want to read from the user’s machine, you will need the File API combined with <input type="file">. Read a file: function…
-
3
votes2
answers946
viewsA: AJAX Javascript Pure Asynchronous
I know you’ve had your answer, but I’d like to explain how to use the XmlHttpRequest API. When you define false in the third parameter of .open you are defining as synchronous: open('POST', url,…
-
0
votes2
answers673
viewsA: PHP: Txt for Array relating lines.
I would do it this way, with the fopen and feof to help save memory and with trim to clean line breaks: <?php function tratarDados($linha) { //Remove espaços do começo e fim nos nomes, valores e…
-
1
votes1
answer499
viewsA: Is there a way to cancel Unload() or Onbeforeunload()?
It is not possible to cancel and even if it were possible it would not be 100% safe, for example the user can kill the process if he wants and this would not trigger the onbeforeunload. The…
-
4
votes2
answers156
viewsQ: What to use instead of "-use-mirrors" in the PIP?
When running the following command I get the following answer: sudo pip install --use-mirrors -r test-infra/requirements.txt Usage: pip install [options] <requirement specifier>…
-
1
votes2
answers175
viewsA: Firefox is not running Jquery’s . css() method, how to fix it?
It’s not a bug from .css, in fact it is a feature that is different in Firefox and in Webkit (or Blink) that by default Webkit has in the property border: the value 0px none rgb(51, 51, 51) in any…
-
1
votes1
answer104
viewsA: Search does not recognize file . zip as valid archive inside a folder
I don’t know much about C#, but in the documentation Directory.GetDirectories did not have parameters, but the parameters mentioned directed to documentation of the DirectoryInfo, try to do this:…
c#answered Guilherme Nascimento 98,651 -
13
votes1
answer3813
viewsA: What is the "application/Ld+json" type for in a <script> tag?
The JSON-LD is one of several types of Schema, as well as the Microdata, it does not do anything pro javascript or pro HTML itself, in fact it is used by searchers, like Google, it is a "data…
-
0
votes1
answer54
viewsA: Page does not load on screen size
This variable seems wrong _stageWebView, you shouldn’t set up on webview? Thus: import flash.geom.Rectangle; import flash.media.StageWebView; var webView:StageWebView = new StageWebView();…
-
3
votes2
answers4022
viewsA: Doubt with table in div css
If you’re going to structure tabular data then use <table> same, this story you probably must have heard from someone who "use tables is wrong" is "badly told", actually the problem is to use…
-
2
votes3
answers1586
viewsA: Composer does not install packages
When you create a project Laravel should already be installed, you probably did not run the Installer, do it first of all: composer global require "laravel/installer" Then try creating a project…
-
3
votes1
answer840
viewsA: Youtube iframe with full link
If this takes the URL: <?php print $insti->video ?> then you can make a parse ID, a good example in Soen thus: <?php /** * get youtube video ID from URL * * @param string $url * @return…
-
47
votes6
answers2300
viewsA: AJAX is not a programming language. So what is it?
The AJAX is a "way" of using the Xmlhttprequest, which is not a language, but a API of Javascript, as well as File API, DOM API, etc.. What the XHR (Xmlhttprequest API) does is a client and server…
-
2
votes2
answers785
viewsA: Selectize.js with Tags, reload key and value in edit form
This is because the <input> when selecting is filled with the AdvogadoId and not with Descricao, when you select for example: What you "see" (gray button with x on the side) is actually the…
-
1
votes1
answer140
viewsA: How to redirect the old domain to the new one?
It’s wrong that, the bar is missing: RewriteRule (.*) http://novodominio.tk$1 [R=301,L] That’s what’s right: RewriteRule (.*) http://novodominio.tk/$1 [R=301,L] I recommend adding a rule to prevent…
htaccessanswered Guilherme Nascimento 98,651 -
0
votes2
answers1676
viewsA: Method App::setLocale() in Laravel 5.2
I don’t know if this is the problem, but this if is wrong: if (Session::has('app.locale')array_key_exists(Session::get('app.locale'), Config::get('languages'))) { The broker would be this: if…
-
13
votes3
answers68478
viewsA: Display PDF file in the body of the HTML page
The use of <iframe> brings some incompatibilities, especially if the browser does not have the plugin, sometimes the file downloads the PDF instead of opening or appearing some error message.…
-
3
votes1
answer392
viewsA: Align text horizontally to image
It’s because the picture is smaller than the block does this: .portfolio-item { text-align: center; } And both images and text will center, note that it is unnecessary to use align="center" in the…
-
2
votes1
answer271
viewsA: Show validation error in View
See that submit() is not returning anything, only the true in case of success: public function submit() { if (empty($this->_error)) { return true; } else { $str = ''; foreach ($this->_error as…
-
3
votes3
answers556
viewsA: Pass multiple variables in Ajax function
There’s a problem here: foreach ($retornos as $retorno) { $array = array('desc_item_1'=>$retorno['descricao']); echo json_encode($array); } You’re probably generating several json, but that…
-
1
votes1
answer1650
viewsA: Multi languages in Laravel 5
Automatically translating will never be perfect, and php or Laravel are not multilingual "databases" that interpret texts in different languages, they are programming language and framework…
laravelanswered Guilherme Nascimento 98,651 -
1
votes1
answer1465
viewsA: Why does this error appear when I include a php file
This is because the included file is saved in UTF8 format with BOM instead of UTF8 without BOM, all files must be saved with ut8 without GOOD, see how to do this with: Using Notepad++: Using Sublime…
-
7
votes1
answer930
viewsA: What is the difference between Classes and Interfaces?
All Interface is a class, but not all class is an interface, the use of interfaces in PHP is similar to other programming languages. A base interface serves to define some standards that the class…
-
26
votes1
answer10816
viewsQ: What is the difference between Mysql and phpMyAdmin?
What’s the difference between Mysql and phpMyAdmin?
-
42
votes1
answer10816
viewsA: What is the difference between Mysql and phpMyAdmin?
What is the Mysql? Mysql is a server that works by TCP, but not by HTTP, in installations like Xampp and Wamp it is not connected directly to Apache or PHP, it is actually a server of database…
-
23
votes1
answer46824
viewsQ: What’s different from Xampp, Wamp, Easyphp, Zwamp and PHP?
What a difference from Xampp, Wamp, Easyphp, Zwamp and PHP? They are all servers? Are all official PHP?
-
35
votes1
answer46824
viewsA: What’s different from Xampp, Wamp, Easyphp, Zwamp and PHP?
Many think there are differences between wamp, xampp and php, which are "distinct servers" What are Ready Packages wamp, zwamp, xampp and easyphp are not "servers" are installation packages with a…
-
3
votes2
answers2485
viewsA: Phrase "Email sent successfully" on the same page of the Form. How to configure?
The use of if ($_SERVER['REQUEST_METHOD'] === 'POST') { is no guarantee, there may be flaws in the script if you use it or just it, as somehow the html form fails or missing some field and still can…
phpanswered Guilherme Nascimento 98,651 -
3
votes1
answer373
viewsA: Force extension appear when downloading via javascript
First always declare the function before using them or set to the .on or use this format function ...() instead of this ... = function(). To solve the problem you must create a link using something…
-
5
votes2
answers1212
viewsA: What does the application gain by using Type Hint?
An addendum to the existing answer in PHP7 ceases to be called hinting type and is called type declaration 'cause this one now supports the guys int, bool, float and string, in addition to those…
-
3
votes7
answers552
viewsA: What is the difference between these parameters (array) in these methods?
Just to complement, as already said in the other answers: //O primeiro parâmetro deve ser array ou vazio (caso vazio assume `array()`) public function exemplo1(array $parameters = array()) //O…
-
1
votes1
answer409
viewsA: Problem with select and use of ajax in Laravel 5
You did it: $.get('/estados?estado' + estado, function(data) { But what’s right is this: $.get('/estados?estado=' + estado, function(data) { A sign of =…
-
2
votes1
answer234
viewsA: File output accentuation problem saved on equipment
Save Document . txt as utf8 without GOOD and will solve. Using Notepad++: Using Sublime Text: Vim: Define the fileencoding as utf8 (I believe I am already without GOOD) :set fileencoding=utf8 :w…
-
2
votes1
answer142
viewsA: How to use PHP files with custom error page in Web.config
I believe that responseMode="File" send the reply as if the file were a static file, if you want to "run it", you should not use \ reversed in this case and the path should start from "root" / (with…
-
0
votes3
answers1454
viewsA: Access all file settings. env
You can try it: var_dump(getenv('DB_HOST')); var_dump(getenv('DB_DATABASE')); var_dump(getenv('DB_USERNAME')); var_dump(getenv('DB_PASSWORD')); If you want to put in an array it will look like this:…
laravel-5answered Guilherme Nascimento 98,651 -
10
votes2
answers8777
viewsA: Delete Javascript and Render Lock CSS?
Javascript This makes the page disappear because one is missing </script> or because of the document.write within onload: <script> var async; function tempo() { async =…
-
1
votes1
answer626
viewsA: Error when connecting PHP Activerecord with XAMPP phpmyadmin
The phpmyadmin is NOT a database, it is only a manager, its PHP applications do not control it, because it is already an application and is not used by the end user of an application is used only by…
-
1
votes1
answer91
viewsA: Submit without reloading page cakephp
You can use jQuery.ajax and jQuery.serialize, thus: <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript"> $(function() { var meuForm =…
-
3
votes1
answer1463
viewsA: How to convert an html page to Image and download IE and Safari?
You are using an outdated version of html2canvas, we are in the version 0.5 that works in the following browsers: Firefox 3.5+ Google Chrome Opera 12+ (presto) IE9+ Safari 6+ Note however…
-
4
votes3
answers114
viewsA: "content: attr" does not validate in W3C
There really is a problem is time to validate by https://jigsaw.w3.org/css-validator it shows this error: Value Error : content Parse Error attr(db) As in the image: The value attr in the content:…
-
0
votes2
answers1124
viewsA: How to rewrite correctly on Nginx?
Assuming that Unicorn and Rails are properly configured, it might be best to use try_files, thus: server { listen 80; server_name localhost; root /var/www/apps/meu_projeto/current/public; try_files…
-
1
votes1
answer906
viewsA: How to escape a javascript variable to the Laravel Slide?
The function is not possible teste(id) runs at runtime on the front-end, {{app\User::find("id")->titulo}} is Blade which in turn is part of Laravel which is a PHP framework and runs in the back…
-
0
votes1
answer150
viewsA: Change table ordering by clicking on JS images
If you are using jQuery you can use the plugin http://tablesorter.com/docs/ Download the desired jquery and then download the jquery.tablesorter.min.js: http://jquery.com/download/…
javascriptanswered Guilherme Nascimento 98,651 -
1
votes2
answers1412
viewsA: Change CSS display with PHP variable
I didn’t quite understand your empty loop and also your <li> is loose, it should go inside UL, but if I understand the problem is only in the HTML part, so I’ll just talk about it, do so: $sql…
phpanswered Guilherme Nascimento 98,651