Posts by Ed Cesar • 403 points
16 posts
-
0
votes2
answers245
viewsA: Check if user changed POST request
Here’s a tip that might be useful: The data you send to your form, save them in a session You will fill in the values below with the data that will come from the bank, which will look like this:…
-
2
votes1
answer3023
viewsA: How to set up a development environment manually
First download the php In http://windows.php.net/download download the latest version of php, download the first file that is a zip and extract in a folder, in this example I will extract in a…
-
4
votes3
answers3152
viewsA: When to use Setters and Getters?
You’ll have people thinking, "I know what I’m doing, so I can leave the public attributes and that’s it!" Getters and Setters go way beyond that, let’s see some utilities: To make validations:…
-
3
votes5
answers28367
viewsA: When to use self vs $this in PHP?
In general, we use the $this to maintain encapsulation and avoid collisions of information from one object into the other. If for some reason you need to share information with all instances of a…
-
1
votes1
answer553
viewsA: Remove php file extension, less than one folder
Place a new. htaccess file in the folder you want to ignore, with: RewriteEngine Off And another at the root with RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/(.+)\.php[^\s]* [NC] RewriteCond…
-
0
votes3
answers1024
viewsA: Take comma-separated values from the database and organize them into <li>
$conteudo = 'Site em HTML5, Alta velocidade, Responsivo'; $conteudoArray = explode(',', $conteudo); echo '<ul>'; foreach($conteudoArray as $conteudo) { …
-
8
votes3
answers5839
viewsA: Namespace declaration statement has to be the very first statement or after any declare call in the script
I’ve been there, the solution is simple, but until I find her... Is the following: Some text editors in UTF-8 environments add BOM at the beginning of text files. In your case it would be enough to…
-
0
votes2
answers838
viewsA: What is the overhead of using object orientation?
In my view, saying not to use OOP because "it consumes more memory and is slower", is the same as: Do not use bootstrap.css because it uses more memory and is slower; Do not use jquery.js because it…
-
1
votes2
answers533
viewsA: Mysql BD random record preventing consecutive equal records
One of the ways is: Create a new column for control, I created one with the name "back" The query was like this: SELECT * FROM `mytable` WHERE volta = 0 OR (SELECT COUNT(volta) FROM mytable WHERE…
-
0
votes3
answers830
viewsA: Convert rows to columns (Pivot?)
Look, this thing works. In this case I’m assuming that the number that has the highest number phone will stay, if you have another column that makes more sense just change: FILTRO = ROW_NUMBER()…
-
-2
votes4
answers23157
viewsA: Identify if the device is pc or mobile and use a different code for each
Use screen.width to catch the width of the screen var largura = screen.width; if( largura <= ? ) { // } This information you need to confirm: Tablets and phones have 767 width down Phones have…
-
0
votes2
answers263
views -
0
votes3
answers1291
viewsA: Fill select javascript / jquery field
Exchange value="", for value='' Also confirm that ajax dataType is HTML
-
0
votes1
answer158
viewsA: popular within the mysql textarea for the form
Try it this way, maybe I typed something wrong, I didn’t test it, but you can understand the idea Return" objQuestoes->numQuestao()}' {$this->isHide}> {$this->label()}…
-
-1
votes2
answers48
views -
5
votes3
answers253
viewsA: Is there a "in" comparator operator in Javascript?
Depending on the scenario it can be interesting to do this, by providing more possibilities: var listaDeNumeros = [2,4,6,8,10]; var numeroAhProcurar = 6; for(numero in listaDeNumeros){ if…