Posts by Guilherme Nascimento • 98,651 points
2,383 posts
-
4
votes1
answer426
viewsA: How to remove a variable from $_SERVER['REQUEST_URI']?
The $_SERVER['REQUEST_URI'] brings the entire url, including the query string, if concactenate it will duplicate the pag= and there will be cases where the url will look like this .php&pag=. Do…
phpanswered Guilherme Nascimento 98,651 -
1
votes1
answer1832
viewsA: How to customize the Laravel 4 error page?
I searched the "Resources" but did not find, however as this link https://driesvints.com/blog/laravel-4-quick-tip-custom-error-pages you can do so: App::error(function($exception, $code) { $error =…
-
2
votes2
answers842
viewsA: Error: No supported Encrypter found. The Cipher and / or key length are invalid
Navigated to the project folder and there is no .env.example is because there was some fault in the installation of Laravel, when we first installed Laravel by Composer it generates a copy inside…
-
12
votes2
answers3664
viewsQ: How to prevent CSRF attack without PHP frameworks?
I have the following files based on other scripts I tried to study: authenticate.php <?php session_start(); if (isset($_POST['token'], $_POST['login'], $_POST['senha'])) { $token =…
-
12
votes5
answers7569
viewsA: How to delete COOKIES in PHP?
Use the function itself setcookie() but with negative value in the third parameter (which is the expires), you can also use unset() with the variable $_COOKIE to delete the key in the current…
-
2
votes2
answers3080
viewsA: How to create an object and methods in PHP
In PHP the __call is used when we call a method or function, something like $baz->foo();, when calling $baz->y->x(); the __call is not fired, because the ->y is an object variable, for…
phpanswered Guilherme Nascimento 98,651 -
7
votes2
answers477
viewsA: Alternative to Scanner for Data Entry
As stated in Soen: Class BufferedReader and InputStreamReader BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = br.readLine(); int i =…
-
2
votes1
answer257
viewsA: Is it wrong to mix $.post with $.ajax in jQuery?
The $.post in fact is the $.ajax, but only makes POST, and the beforeSend is used to configure a specific jQuery ajax event/request, it is not wrong to use both, what is wrong is more the way you…
-
1
votes1
answer219
viewsQ: When to use "0.x. x" and "alpha" in versioning?
According to the website http://semver.org/lang/pt-BR/ Given a version number MAJOR.MINOR.PATCH, increment the: Major (Major): when making incompatible changes to the API Minor version(MINOR): when…
versioningasked Guilherme Nascimento 98,651 -
4
votes2
answers559
viewsA: Make a condition to check URL
Codeigniter as well as many php frameworks works works with Controllers and Views, in the case of CI3 would look like this: login: <?php class Login extends CI_Controller { public function…
-
0
votes2
answers98
viewsA: Send querystring in a PHP request
CURL The curl requires on some servers have enabled, however you can try enabling by php.ini, remove the ; of ;extension=..., for example: ;Windows server extension=php_curl.dll ;Like-unix server…
-
2
votes2
answers124
viewsA: Is there any way to toggle with attributes in jQuery?
Can create something with jQuery.fn, thus: jQuery.fn.extend({ toggleAttribute: function(attr, value) { if (typeof value !== "string") { value = "true"; } //Pega os elementos que tem o atributo var…
jqueryanswered Guilherme Nascimento 98,651 -
6
votes3
answers2099
viewsA: Is it safe and feasible to minify PHP files?
If the minification is well done, usually by a reliable (reputable) software or script then there will be no problems with the HTML interpreter even in older browsers, the only thing you maybe you…
-
2
votes3
answers1345
viewsA: It is possible to configure upload_max_filesize via . htaccess
To complement the other answer, to use php setup by . htaccess you must have installed the mod_php, if your server or hosting has no availability will appear an error message on all error pages 500…
phpanswered Guilherme Nascimento 98,651 -
1
votes2
answers307
viewsA: Localstorage doesn’t keep names with accents?
This is because the file www/php/login.php is coming without accents I always tell you to post the code that can be reproduced, but it seems that you always fail in this, again please to avoid…
-
2
votes2
answers976
viewsA: Attribute "wrap" of the textarea tag
Just to complement the other answer, as the documentation MDN Specifies how to break the text in <textarea> hard: The browser automatically inserts line breaks (CR+LF) at the time the form is…
-
0
votes1
answer1158
viewsA: apache2 installation error
Open the terminal and enter the following commands: Rename the current sources.list (or remove): sudo mv /etc/apt/sources.list /etc/apt/sources.list.old Open the program software-properties-gtk:…
-
5
votes2
answers1589
viewsA: How to nested Tables with bootstrap?
In case Bootstrap requires jQuery, then you can use jQuery, just need to port the element with $(...).next(). Example: $(document).on("click", ".mytable .open", function() { var tr =…
-
2
votes1
answer909
viewsA: Is there an image upload plugin for Summernote?
The editor Summernote already have option natively to convert the image to protocol data: (Data URI Scheme) so the image goes "embedded" with the text: $(document).ready(function() {…
-
1
votes2
answers831
viewsA: Using dynamic maps with the Google Maps API
I don’t quite understand how you’re gonna use the Googlemaps API with C#, will probably be a webView, I won’t go into details because the webView can be something Desktop or Windowsphone (or other…
-
1
votes1
answer51
viewsA: Error Call to Undefined Function mysqli_num_roms
mysqli_num_roms does not exist, in English lines is rows, so if you want to take the number of lines use: if (mysqli_num_rows($SQL) != 0) { echo "logado"; } else { echo "Login incorreto"; } Always…
phpanswered Guilherme Nascimento 98,651 -
6
votes1
answer1336
viewsA: How to convert video with php without using ffmpeg?
Researching the only one I found that seems satisfactory was http://www.online-convert.com, follows links: Brief documentation: http://www.online-convert.com/developer http://api.online-convert.com…
phpanswered Guilherme Nascimento 98,651 -
3
votes1
answer420
viewsA: How to load a URL that is inside a . txt from the Web View?
If the URL is inside a TXT you will need to read this TXT first using, of course the file must contain only the URL. Using this answer as the basis https://stackoverflow.com/a/12421888/1518921 you…
-
2
votes3
answers233
viewsA: Filereader or IE9 alternative
According to the documentation of MDN of API File is supported by the following browsers: Chrome version 13 Firefox (Gecko) version 3.0 (1.9) Internet Explorer version 10.0 Opera version 11.5…
javascriptanswered Guilherme Nascimento 98,651 -
6
votes1
answer2038
viewsA: How to edit HTML in a WYSIWYG (Tinymce) editor and save to the bank?
The Tinymce editor before being a "rich text" editor is a normal form, so if you want to edit it you must convert the < and > for < and >, as in the example: <!DOCTYPE…
-
7
votes1
answer2595
viewsA: How to use the arguments passed to a python script?
According to this response from Soen, you can import the library sys, some examples: import sys print "\n".join(sys.argv) Another example with sys import sys for value in sys.argv: print value…
pythonanswered Guilherme Nascimento 98,651 -
2
votes2
answers953
viewsA: Point to different directory in . htaccess
Use ../../../ will not work at all because . htaccess works from the "Base" directory or you have defined as "Base". By default the Base is the local itself that . htaccess is located and in case…
-
1
votes1
answer856
viewsA: Carrier braspress and Wordpress Woocommerce
The title has nothing to do with what is asked, carrier braspress is a company (as far as I know) and has nothing to do with the technology mentioned and what needs. The question is: Is it a…
-
1
votes2
answers527
viewsA: Precision problem in Geolocation maps V3
There is no accuracy at all, googlemaps is a tool that always works being improved and updated data, but understand that this is at a global level and even being one of the largest companies in the…
-
0
votes1
answer50
viewsA: PHP-CPP Compilation Version
Unfortunately there is no way to create a universal compilation, each version of php actually has different builds, this occurs in any software, not only php. This problem occurs because of…
-
9
votes5
answers10050
viewsA: Run script js when trying to close the window
Even if you use unload or beforeunload the form will never be displayed, this is because there is no way to prevent this, the use of unload is aimed at small actions, such as destroying cookies or…
-
7
votes3
answers872
viewsA: Split into two parts when it contains more delimiter in string with explode
The explode is configured to divide the string by spaces, its string is clearly full of spaces: $produto = 'Leite Pasteurizado, Mucuri, Integral, 1 L'; When the explode, it returns an array like…
phpanswered Guilherme Nascimento 98,651 -
7
votes1
answer307
viewsA: Block old browsers
You didn’t tag it javascript, but there are interesting projects that can help you: https://github.com/burocratik/outdated-browser To use include css: <link rel="stylesheet"…
-
2
votes1
answer791
viewsA: Date Timer
Using the example of this reply, but with hours minutes and seconds: $termina = new \DateTime('2017-12-11 11:14:15'); $hoje = new \DateTime(); $intervalo = $hoje->diff($termina); echo "Intervalo…
-
3
votes2
answers212
viewsA: Searching the letter variable after the point to validate upload in the Dropzone
If to grab the extension a file remember names may have point before the extension which will make your script (/a/112999/3635) fail. You can do it this way: var v = "ARQUIVO.1.2.3.4.PNG"; var splt…
-
2
votes1
answer83
viewsA: Error in Windows 10: Error retrieving Parent for item
in accordance with reply on Soen and in this other reply on Soen is not a problem with Windows but with Android SDK, this probably occurs because after the update the default is api version 23. Your…
-
2
votes1
answer1042
viewsA: My site is giving as false (fraud, phishing), how to solve?
According to the link: https://support.mozilla.org/pt-BR/kb/como-funciona-protecao-phishing-e-software-malicioso?as=u&utm_source=inproduct To request removal from the fraud list fill in the…
domainanswered Guilherme Nascimento 98,651 -
1
votes1
answer527
viewsA: PHP - Setting SESSION time on already defined functions
The logic of sessions is to be destroyed the moment the "browser closes", however it is possible to control the time of the "session" and the "cookie" that maintains the session. But before I tell…
-
1
votes3
answers222
viewsA: How to prevent the edge from affecting child elements
The effect is exactly this same, both with box-sizing: border-box; or not, because it is not the image that received the border but an element parent and this affects the image. The solution is not…
cssanswered Guilherme Nascimento 98,651 -
2
votes3
answers772
viewsA: How to manipulate txt lines in php?
To insert into rows instead of using file_put_contents use fwrite (or fput) and it will be necessary to use PHP_EOL for line breaks. Note it is recommended to convert the message into html entities…
phpanswered Guilherme Nascimento 98,651 -
1
votes1
answer87
viewsA: How many weeks ago in the month with PHP
An example in soen $mes = 2; $ano = 2016; $days = cal_days_in_month(CAL_GREGORIAN, $mes, $ano); $week_day = date("N", mktime(0,0,0,1, $mes, $ano)); $weeks = ceil(($days + $week_day) / 7); echo…
phpanswered Guilherme Nascimento 98,651 -
1
votes2
answers1021
viewsA: Height 100% in Side-Bar
If you want the height to accompany the content you must change height: 100% for min-height: 100% thus: .main { min-height: 100%; width: 100%; position: relative; display: block; } .side-bar {…
-
3
votes1
answer1597
viewsA: Activate Laravel Maintenance Mode 5.1 No Artisan
Yes it is possible without terminal, but first I will talk about php artisan down, it is not because you have moved a project to the server that the command artisan will work. Usually we only move…
-
1
votes2
answers832
viewsA: I can’t log into Magento 1.9.2
You restored the folder data mysql? Then you probably lost the data (I hope you have a backup). About not starting from mysql (which is what triggered the problem) instead of leaving by deleting…
magentoanswered Guilherme Nascimento 98,651 -
1
votes1
answer3205
viewsA: Error 500 while accessing page using Checkspelling in htaccess
The RewriteEngine On is used to mod_rewrite, but there is nothing written, ie it seems to do nothing, so remove. Already the CheckSpelling On is likely to be disabled, so you should enable it in the…
-
2
votes2
answers171
viewsA: Paging in search failed when switching pages
$_POST is for forms with <form method="POST">, to use page you will probably have to use GET, assuming the url looks like this: pagina.php?busca=1 In all variables GET or POST always check the…
phpanswered Guilherme Nascimento 98,651 -
11
votes2
answers2794
viewsA: What is the difference between setInterval/setTimeout and Web Workers?
The setInterval The setInterval is an asynchronous loop within the current javascript process, i.e., it runs on the same layer as the larger process although it does not need to wait, however if…
-
1
votes2
answers1136
viewsA: How to make full-page vertical slides that roll with the mouse scroll?
As an alternative there is already a jQuery plugin ready for this, is the: https://github.com/alvarotrigo/fullPage.js Go to to to download:…
-
15
votes6
answers3379
viewsA: How to find out if the year is leap in PHP?
An alternative solution is to use a native PHP function that is suitable for this, the cal_days_in_month Examples: <?php //2015 não é bisexto $result = cal_days_in_month(CAL_GREGORIAN, 2, 2015)…
-
1
votes1
answer1592
viewsA: Resize and write PNG with transparent background
The problem is with the alpha, to solve this you can use the functions imagealphablending, imagesavealpha and imagecolorallocatealpha. As described here imagepng() and Transparency in GD library…
phpanswered Guilherme Nascimento 98,651