Posts by Guilherme Nascimento • 98,651 points
2,383 posts
-
2
votes1
answer153
viewsQ: Can a Model use a Webservice for "business rules"?
When using some ready-made frameworks (such as Laravel and Codeigniter), I noticed that Models are usually extended from other classes that usually connect directly to the database, so I understood…
-
11
votes2
answers2210
viewsA: PHP on linux or windows
And what is this myth that only the elderly use linux? Don’t believe everything they tell you :) PHP is a cross-platform language, that is to say just have PHP installed for the version of the…
-
1
votes2
answers211
viewsA: Display mp3 path instead of downloading
Remove this from your code $mp3->output('word.mp3'); and in the class you can add a new method, in this method you will have to manipulate the variable $this->str, would be something like:…
phpanswered Guilherme Nascimento 98,651 -
13
votes3
answers2379
viewsQ: When is the controller needed?
I rarely use MVC for the simple fact that me it seems that each person uses their way, I know that the MVC came before the web, while reading these links I had a feeling that it seems that one…
mvcasked Guilherme Nascimento 98,651 -
8
votes1
answer10416
viewsQ: Is it possible to list all the neighborhoods of a city?
I am using the Google-Maps API, but I did not find anywhere in the documentation something related, I would like to list all the neighborhoods of a specific city, but the items with neighborhood…
google-mapsasked Guilherme Nascimento 98,651 -
3
votes1
answer2619
viewsA: Free access to folders in . htaccess
Believe that I was working with a framework and had this same problem 2 hours, rs If I understand what you asked, so that the informed folder is not affected by mod_rewrite you must add a new…
htaccessanswered Guilherme Nascimento 98,651 -
2
votes1
answer545
viewsA: Migrate from PHP 5.2.9 to PHP 5.6.8
The extent php5 is customized, in other words it has nothing to do with the php version, since in Apache (I suppose this may be your server) you can use the extension you want. What you’ll probably…
-
3
votes2
answers3046
viewsQ: Dots and accents in mod_rewrite Urls
I noticed that many systems that use mod_rewrite (or equivalent) usually do not support Urls with accents, usually they replace the characters as dot (dot) by hyphen (-) and accents for their…
-
12
votes3
answers2583
viewsQ: include, require inside functions methods
Use include (or require) within a function or method may cause some conflict or problem with older versions of PHP (such as 5.3)? I noticed that most frameworks working with MVC use require within a…
-
2
votes1
answer184
viewsA: Get $_SERVER user information via socket
To bring the IP and data you will need to change the function socket_recv by function socket_recvfrom About my previous answer, ignore her, that part I said on the "CLI doesn’t work", I was totally…
-
5
votes2
answers400
viewsA: Compatibility, legality and possible problems with the open source license change
Not Your project license is still a derivative work that is bound by the GPL restrictions. This means that you would have to release it under the same conditions as the GPL. You cannot release it…
licenseanswered Guilherme Nascimento 98,651 -
8
votes1
answer198
viewsA: Reduced ternary in PHP - Error or misinterpreted?
Would return 5.25 if you did so: var_dump($vlTeste1 ?: 9.99); //Retorna float(5.25) If you do var_dump($vlTeste1 > 0 ?: 9.99); //Retorna bool(true) ou float(9.99) He will return the $vlTeste1…
phpanswered Guilherme Nascimento 98,651 -
0
votes2
answers214
viewsA: UPLOADIFY plugin does not send MP3
I don’t know which version you are using, but this is wrong in the latest version (using SWF): 'uploader': '/public/js/Uploadify2.1.4/uploadify.swf', 'script': '/uploadArquivo', uploader: should be…
jquery-pluginsanswered Guilherme Nascimento 98,651 -
2
votes2
answers994
viewsA: Simulate click without directly calling the function
Your code seems to be correct, there’s only one thing wrong getElementsByName returns a list of items (equivalent to array), sure would be: var send = document.getElementsByName("send");…
javascriptanswered Guilherme Nascimento 98,651 -
1
votes3
answers325
viewsA: Create select using "for" cycle
Although not specified, the author seems to be using cakephp, You can use it like this: $array = array( '' => 'Selecione...' ); for ($i = 1; $i < 49; ++$i) { if ($i === 1) { $array['1'] = '1…
-
5
votes1
answer1286
viewsA: Where to put PHP code that takes user machine information?
Its doubt is not very clear, but if I understood it has two possible "environments": I recommend using include, require, etc before anything else, to keep the project organization Before rendering:…
phpanswered Guilherme Nascimento 98,651 -
2
votes1
answer117
viewsA: It is possible to get the Error Number returned by Page
If it’s PHP, you can try this: ErrorDocument 403 http://localhost/pasta-do-meu-projeto/erro.php?status=403 ErrorDocument 404 http://localhost/pasta-do-meu-projeto/erro.php?status=404 ErrorDocument…
-
3
votes2
answers1086
viewsA: Disable/ enable scroll with Jquery
You can use is(":visible"), I believe when the window closes you use display: none, try like this: $('#close').click(function() { $('#el').fadeOut(); }); $('#el').click(function() { var $this =…
jqueryanswered Guilherme Nascimento 98,651 -
1
votes2
answers2792
viewsA: Practice deploying, how to do?
I don’t understand what you want exactly, but there are two tools for this Simple PHP Git deploy script: Automatically deploys code using PHP and Git. Repository:…
phpanswered Guilherme Nascimento 98,651 -
1
votes1
answer1190
viewsA: Error "Cannot read Property 'x' of Undefined" Raphael.js
Has two problems; You twice added Raphal.js <script type="text/javascript" src="raphael.js"></script> <script type="text/javascript"…
javascriptanswered Guilherme Nascimento 98,651 -
3
votes2
answers283
viewsA: Regexp does not take input value
Your Regex is different from your html-input, just compare: <input value="2530317385" name="X-Tmx-session-id" id="X-Tmx-session-id" type="hidden"> ~<input type=hidden id=X-Tmx-session-id…
-
2
votes1
answer466
viewsA: Capture of Print Event
I believe this is what you seek Findfirstprinterchangenotification Function Syntax C++: HANDLE FindFirstPrinterChangeNotification( _In_ HANDLE hPrinter, DWORD fdwFilter, DWORD fdwOptions, _In_opt_…
c#answered Guilherme Nascimento 98,651 -
1
votes1
answer2120
viewsA: Prevent from closing modal window
There is no way to prevent you from closing the browser or updating the page, but you can send the user a confirmation window, for example: window.onbeforeunload = function() { return "Você não…
twitter-bootstrapanswered Guilherme Nascimento 98,651 -
8
votes1
answer137
viewsA: How to transcribe Javascript functions to PHP
Follow this: The equivalent of string.length would be strlen($string) to count the number of characters, to have Unicode compatibility, use: $j = preg_match_all('/.{1}/us', $string, $data); The…
phpanswered Guilherme Nascimento 98,651 -
2
votes1
answer788
viewsA: Array is not converted to JSON
By mistake Erreur de syntaxe pr�s with this character �, I assume you’re trying to pass a string that uses iso-8859-1(latin) instead of utf-8, your page is likely to be utf8, but there are files…
-
1
votes2
answers200
viewsA: Error loading listview of parse.com
By mistake Didn't find class "bolts.Task" is saying that the class does not exist (did not find the class "bolts.Task"), it is likely that the package referring to the class was not added to the…
-
1
votes1
answer168
viewsA: How to simplify the use of str_replace
Create a function to apply to all necessary items from $_POST, for example: function formatFromMaskMoney($value) { $value = str_replace(' ', '', $value); $value = str_replace('.', '', $value);…
-
6
votes3
answers1471
viewsA: Use Command Line with C#
You want to do the same procedure cmd within an application written in c#? If this is it, then you can use System.Diagnostics.Process. You will have to unite the command cd with the openssl using…
-
5
votes1
answer677
viewsA: Transform Scale does not work with expected
You must use the property transform-origin, note that it is necessary to define transform in the element without :hover, for the browser to undo the effect. As per @Gabrieloshiro’s response, you can…
css3answered Guilherme Nascimento 98,651 -
5
votes2
answers8611
viewsA: How to justify the text in a Textview?
The TextView does not support this type of alignment. You can make an application based on HTML instead of TextView, as suggested by this link: The only way, how to align a block text on Android?…
-
3
votes2
answers2045
viewsA: PHP accent problem, Mysql
Database latin1_swedish_ci should not be used with utf8, if not you will stay in the gambiarra to solve the problem. Bank latin1, then use on the page <meta http-equiv="content-type"…
-
2
votes1
answer456
viewsA: Scroll with Animate does not work
In some browsers the scrollbar is in body and in others it is in html, so you should change the selector to: $('html,body').animate({scrollTop:target}, 300); Should stay like this:…
-
2
votes4
answers1091
viewsA: HTML DIV ID set with echo
I believe that the According to Code goes into the archive include("thumbimg.php");. Code problems: With each loop you are repeating the function display() {...} and in var elem =…
-
1
votes1
answer808
viewsA: Onchange with double value
If I understand your doubt, you want to change the 0 in Publicidades(this.value, 0) and Publicidades(0,this.value) at the current value of the other select. For this you can use properties like:…
-
1
votes2
answers786
viewsA: What is the simplest way to print an idented javascript text to html?
I don’t know if I understand your question, I believe you have a code saved in a database or text file and you want to display your source in an HTML, if this is it, you can use the <pre>:…
-
1
votes2
answers777
viewsA: Error installing Composer on Windows 7 64bit with Wampserver 2.5
I believe you have to activate ssl in PHP, in your php.ini, look for the line: ;extension=php_openssl.dll Remove the ;, save the file and restart Apache/Wamp, if the line is not found, add it.…
-
0
votes2
answers1019
viewsA: How to avoid HTML Injection and XSS on . JSP pages?
Like Victor said, the <pre> doesn’t prevent this, maybe you’re thinking that this tag converts the content to entities, but maybe it’s just a mess. I personally allow the exact recording of…
-
1
votes1
answer391
viewsA: Check if you have the string and include its tags
Testing your code better, I noticed that the text repeats a few times, this is because of the use of getElementsByTagName which takes the parent element and the child element and the loop presents…
phpanswered Guilherme Nascimento 98,651 -
3
votes2
answers785
viewsA: E-mail UTF-8 via ASP with CDONT
Working with UTF-8 is not enough Response.CodePage and the Response.Charset, it is necessary to save both documents in UTF-8 NO GOOD, both the upload file and the file containing the form. Two…
-
1
votes1
answer205
viewsA: Notice: Undefined index in file type field
The jQuery.ajax does not support upload if you do not use File API, therefore I believe that it converts the variable input-surname to POST (then on the server you get $_POST['input-surname']). You…
phpanswered Guilherme Nascimento 98,651 -
1
votes1
answer107
viewsA: Create existing array array
If you need to use the implode, then you can declare two variables, one for the formed string and the other for the array: $valoresArray = array_values($dados); $valoresStr = implode(", ",…
-
0
votes1
answer122
viewsA: Why does my JS display alert when you don’t need it?
I don’t have much knowledge of backbone.js, so I understand the template generates a loop for the past content to render: <script type="text/x-handlebars-template" id="tpl-user-add"> ...…
-
2
votes1
answer675
viewsA: e-mail
The alert does not appear because of header('Location: ...') Use javascript: $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=utf-8\r\n"; $headers .= "De…
-
9
votes2
answers2492
viewsQ: What’s the difference between SOME, IN and ANY?
What is the difference of SOME, IN and ANY in Mysql and when to use them? They have a bad performance if used often in the same SELECT?…
mysqlasked Guilherme Nascimento 98,651 -
5
votes3
answers1954
viewsA: optimize jquery datatable with a database with more than 30,000 records
Uploading all data at once is a bad idea, regardless of whether you save it on the front end or back end, always limit your results, in the case of "database" the best solution is to use LIMIT (I…
-
3
votes1
answer1293
viewsA: How to apply multiple image upload
Do not use $arquivoImagem = $_POST["arquivo"]; use $arquivoImagem = $_FILES["arquivo"]; $_FILES['userfile']['name'] The original file name on the client’s machine. $_FILES['userfile']['type'] The…
-
7
votes1
answer233
viewsA: What exactly is the element.class selector?
In a brief explanation; The elemento .classe equivalent there is elemento *.classe, empty is "abbreviated" use of the asterisk *, which serves to apply CSS to all elements, for example: * {} style…
cssanswered Guilherme Nascimento 98,651 -
0
votes1
answer345
viewsA: Map in SVG in Wordpress
It is likely that the ID #map is already being used by another element on your page and probably already has style rules added, the best alternative is to change the ID (remember not only because of…
-
1
votes1
answer1895
viewsA: How to identify which user is on my website page with Jquery
According to the response of Soen you can use the Page Visibility API that lets you detect if a page is hidden. Browsers that support: Chrome 13+ Internet Explorer 10+ Firefox 10+ Opera 12.10+…
-
16
votes2
answers8570
viewsA: Get "waves" from sound or music frequency
If the audio "wave" is static (no animation), you can use the Wavesurfer Download: http://wavesurfer-js.org/dist/wavesurfer.min.js Documentation:…
javascriptanswered Guilherme Nascimento 98,651