Posts by Édipo Costa Rebouças • 1,098 points
22 posts
-
0
votes1
answer466
viewsA: obfuscate javascript code with php
Today most projects with serious javascript development end up doing this with nodejs and webpack as part of the process of build. With PHP, searching fast I found this library, the PHP-Packer.…
-
0
votes1
answer158
viewsA: Does not return the variable value
Your code works. function get_string_between(){ return 'teste'; } $linhas = array(1,2,3,4,6,7); $novalinhas = ''; foreach ($linhas as $novalinha){ $novoTituloSlug = get_string_between($novalinha,…
phpanswered Édipo Costa Rebouças 1,098 -
2
votes5
answers1659
viewsA: Default parameters
function exemplo($par1 = null, $par2 = null) { $_par1 = null === $par1 ? 1 : $par1; $_par2 = null === $par2 ? 2 : $par2; return $_par1 . ' - ' . $_par2; } Consistent behavior if you use…
-
0
votes3
answers487
viewsA: How to update PHP Timezone with javascript using the Date.getTimezoneOffset function?
I answered someone else about a question that looked just like that. What I pointed out to her was to use Timezone UTC, because javascript converts the local time to UTC, and UTC to Local, and PHP…
-
2
votes1
answer449
viewsA: Curl login page in ASP does not authenticate
The time I did this I had to pass these variables with underline and I used a class I found on the internet to make the requests, because I was not able to properly control the request with Curl.…
-
2
votes1
answer383
viewsA: Load pages without duplicating content through AJAX
Most template systems I know work with the view and layout concept. The view would be that of you indexPost.html and the layout indexGet.html, with the impression of a variable $content in place of…
-
6
votes1
answer1740
viewsA: Run PHP (Zend Framework) application on the server
After a long conversation, we were able to move up the application with these steps. Install PHP 5.5 because the server was using PHP 5.3 and the project used PHP 5.4 syntax Install mysql driver for…
-
8
votes1
answer319
viewsA: Apostrophe within echo
The problem is that you are using apostropho(') for the attributes of your div and also for things within the attribute, and escapes needlessly, in which the browser tries to interpret something of…
-
1
votes2
answers473
viewsA: SELECT with CASE runs on phpMyAdmin but does not pass in PHP
Spaces are missing, string concatenation is generating things like tipoWHEN. believe that you could use a syntax less prone to errors, for example: <?php $query = " SELECT `idforma_pagamento`,…
mysqlanswered Édipo Costa Rebouças 1,098 -
1
votes1
answer96
viewsA: Activators (triggers) in PHP
I believe you can implement this with regular expression, follow an example: <?php $regex = '/nato (?<nato>[a-z0-9 ]+)/'; $vocabulario = array('a' => "Alfa", 'b' => "Bravo", 'c' =>…
-
3
votes4
answers941
viewsA: Time Sync() PHP and Javascript
To return which is the current Timezone, you can use the getTimezoneOffset. var timezoneoffset = new Date().getTimezoneOffset(); This will return the difference in minutes of local time and UTC time…
-
0
votes2
answers791
viewsA: What are the advantages and disadvantages of declaring constants as an array?
It’s almost always good to have more options, it makes the language more versatile. If the class had constants for months, perhaps it would be better to use something like the Splenum example…
-
1
votes3
answers761
viewsA: Form.serialize() does not work
Your code seems to be correct, if it is to kick something I believe that maybe you have two presses with this id, or any other div, and that in this way, has no value selected or does not have these…
-
4
votes1
answer133
viewsA: Identify SVG elements
You will only get by getElementById after you insert the svg into the document. Following example: http://jsfiddle.net/e99nyam7/ <svg width="200" height="500"></svg> <script> var…
-
1
votes2
answers3006
viewsA: Charset problem PHP + MYSQL + new server
I believe you have created the new database with the wrong charset, and the tables of this database are inheriting this new charset. See which is the charset of your old database and configure the…
-
4
votes1
answer384
viewsA: Configuring Cakephp with Composer
According to the project’s github, this is the correct installation path via Poser. Because this plugin has the type cakephp-plugin set in it’s Own Composer.json, Composer Knows to install it Inside…
-
28
votes2
answers13485
viewsA: Composer - Autoload and PSR-0 vs PSR-4
The difference is that with the PSR-0 the autoloader will look for a folder with the name of the namespace you configured inside the directory and with the PSR-4 it will use the folder you set as…
-
11
votes6
answers1673
viewsA: Big job or small job?
What I try to do I try to follow the concept of making classes and functions with only a responsibility. Programming with this principle, naturally you will generate smaller functions and classes.…
-
1
votes3
answers1863
viewsA: Return of content by Curl
About printing, Banrisul already provides a link on the page generated with this functionality. In your case, I would open the link in a pop-up and let the person click the print.
-
1
votes1
answer108
viewsA: Zend Framework 2 add simple mode Assets
Zend indicates to use a directory structure where each module has its own folder public with the Assets, but it does not solve how to make these files available. You can simply play your Assets…
zendanswered Édipo Costa Rebouças 1,098 -
1
votes2
answers3709
viewsA: Crud Energy with PDO
If you want to use PDO because it is safer, then stop now. The benefits of using PDO are: Object-oriented interface to interact with the database (counterpoint the functions) Unified database…
-
2
votes2
answers278
viewsA: ZF1 resulting from controller in view
I believe the problem is more logical than with Zend Framework 1. If you make the code you said $this->view->filmes = $resultadoFilmes; You’ll just take the last actor’s movies, which might be…