Posts by Alan Rezende • 1,016 points
31 posts
-
2
votes2
answers2417
viewsA: Angularjs $http.get
Use inside the callback success of the get: $http.get("api/endpoint").success(function(data){ // a partir daqui utilize a variável "data" em seu post $http({method:'POST', url:'api/endpoint2',…
-
2
votes3
answers4136
viewsA: How to subtract a date from the current system date
In PHP the functions mktime() and time() can help you: whereas the loan date is 2015-29-10 in a very didactic way we would have: <?php $data1 = "2015-10-29"; $data1 = explode("-", $data1);…
-
2
votes1
answer610
viewsA: shopping cart
The ideal in these cases is to use the safe pag api for php (Documentation here). Inside we can add the products as follows: $paymentRequest = new PagSeguroPaymentRequest();…
phpanswered Alan Rezende 1,016 -
4
votes1
answer358
viewsQ: Doubt about the socket.io functioning
I have a question regarding the socket.io that I have already researched in several places and most of a rolled up or uses some obscure terms, but ends up not answering the doubt directly. The…
-
2
votes2
answers522
viewsA: How to click and scroll a hidden part?
You need to add jQuery to your code. use the code below before your javascript code. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> Ex:…
-
10
votes4
answers4258
viewsA: How to prevent direct access to my PHP code?
I use in the htaccess from my wordpress blog the following rule <Files *.php> Order Deny,Allow Deny from all </Files> <Files index.php> Order Allow,Deny Allow from all…
phpanswered Alan Rezende 1,016 -
4
votes1
answer81
viewsA: File Upload
Error message says the folder /public_html/publico does not exist. Check if it exists and if you are allowed to save files within it. Check the exact location of the folder Enter the relative name…
-
0
votes2
answers233
viewsA: Align navigation menu in the center
Let your #drop with with:auto #drop { margin-top: 0px; display: inline-block; width: auto; } Look in the plunker http://plnkr.co/edit/dpbe5xY9AIgrGcVeVcCa?p=preview…
-
0
votes2
answers599
viewsA: menu with the selected option of another color in Angularjs
The ng-class shall be used with the name of a class and an expression: <ANY class="ng-class: expressao;"> ... </ANY> An example of my code: <li ng-class="{active : geral.navID ==…
-
3
votes2
answers244
viewsA: Customize css link as per url
use for example a[href="http://site.com.br/something"]{ font-size: 30px; } To consider only a part of the url, just use a * right after href a[href*="something"]{ font-size: 30px; }…
cssanswered Alan Rezende 1,016 -
1
votes1
answer695
viewsQ: Bootstrap Sass, which is the best way to use to avoid attribute redundancy
I am using the Sass version of boostrap, and would like to know what is the best practice. I have the assets bootstrap originals and have mine assets personal that I believe overwrite the boostrap…
-
0
votes2
answers174
viewsA: Grouped id rendering speed vs class
Good morning on this link has a good specification on the rendering speed of css encompassing ids, classes, tags and universal.…
-
0
votes2
answers998
viewsA: phpmailler error while sending email
Do not pass email as array, pass as CSV, comma-separated values: [email protected], [email protected] To transform the array $to in CSV use function implode $to = array($mail); $to = implode($to, ",");…
-
7
votes1
answer244
viewsQ: Custom post url structure with tags and tag listing
Hello I’m trying to reach the following url structure for the post personalizado portifolio: website.com/portifolio - Display all posts - OK website.com/portifolio/Slug - Displays the portifolio…
-
0
votes2
answers264
viewsA: folder permission error
Have servers that need permissions kind of cascade, ex: /user/teste/arquivos/fotos/etc If your folder /etc has 777 but the photos don’t have, doesn’t work. Try to give permission 777 for the folders…
phpanswered Alan Rezende 1,016 -
5
votes1
answer371
viewsA: Set Pagseguro API delivery address
Use the setShippingAddress $shipping->setShippingAddress( '01452002', 'Av. Brig. Faria Lima', '1384', 'apto. 114', 'Jardim Paulistano', 'São Paulo', 'SP', 'BRA' ); Complete code: $paymentRequest…
-
4
votes1
answer2752
viewsA: Where is stored the path of posts images in Wordpress?
The files are in wp-content/uploads/ In the database: As highlighted images are saved in the table postmeta with the meta_key of _wp_attached_file and related to meta_key of _thumbnail_id As images…
-
3
votes2
answers327
viewsA: Set file name in input file dialog
So far, for security reasons it is not possible to set the folder in which the input file will open nor the predefined file name. This is done by security measure to prevent the user from submitting…
-
1
votes1
answer99
viewsA: Is it possible to use imagecopyresampled and imagecopymerge at the same time?
Yeah, there’s a way. Let’s say you have this image of yourself as a result of imagecopyresampled in the variable $minhaImagem, you can use it $dst_im of imagecopymerge imagecopymerge ( $minhaImagem…
phpanswered Alan Rezende 1,016 -
0
votes2
answers366
viewsA: List all "date" attributes containing a particular code
With this little snipet you can list all attributes with data at the beginning of the name on the console, from there you can adapt it to your needs: var item = $("#products-end");…
-
1
votes1
answer348
viewsA: Time zone in JS
This is not possible with javascript, you need some language running on the server (php for example) to ensure the effectiveness of the lock.
-
1
votes1
answer24
viewsA: Command not redirecting
You placed the redirect inside a function, but did not execute it. You have some options: 1 - Put out of function: <script type="text/javascript"> <?php $idComp = (@$_POST['id']); $insert =…
javascriptanswered Alan Rezende 1,016 -
1
votes1
answer73
viewsA: How to bring the selected ball forward (z-index major) in Highcharts?
Try to use the z-index with a higher value, ex: 999999 and remember that z-index only works with position informed, ex: position:relative; z-index:999999;…
highchartsanswered Alan Rezende 1,016 -
0
votes2
answers146
viewsA: Select only one item
Try to use as your first ID field, ie using $ver[1] and use the attribute name. <input type="radio" value="<?php echo "$ver[0]"; ?>" name="selecionado" />…
-
3
votes3
answers175
viewsA: Counting filtered dates per day in Mysql
You need to run a query to convert all your formatted fields dd/mm/aaaa hh:mm:ss for aaaa-mm-dd hh:mm:ss because this is the standard adopted by mysql. Query example UPDATE tabela SET data_cadastro…
-
4
votes2
answers9874
viewsA: PHP variable in an HTML value
Use the php tag <?php echo $id1; ?> or <?=$id1?> (if php short tags is enabled) ex: <input type="radio" value="<?php echo $id1; ?>">…
-
1
votes1
answer465
viewsA: Check Real-time API Connection Angularjs
The ideal would be to 'drip' the api in a pre-established time interval, like 10 sec. I’ve used it like this. Ai if ping returns an error we inform the user.
-
2
votes1
answer893
viewsA: How to validate session with Angularjs and PHP?
Assuming you are consuming something in ajax to the templates of an API for example, after logging in, any ajax page that you want to access on the server must have some sort of verification if the…
-
2
votes1
answer865
viewsA: Function/Method to change a variable from another PHP file?
You who save the status if the user is logged in or not? The best way is to use a session for that: You wouldn’t need the file anymore LoginStatus.php in his index.php <?php session_start();…
-
1
votes1
answer397
viewsA: How to pass data from Angular to a php class?
Posts at the angle are shot as Request Payload, so on the PHP side you can get them that way $payload = json_decode(file_get_contents('php://input')); $id_empresa = $payload->id_empresa; Also…
-
2
votes2
answers1319
viewsA: Laravel error in installation
You need to have the /Users/seu-nome-de-usuario/.composer/vendor/bin in your Path so that the Executable can be used in any system folder. To check if your path contains the path of the Composer run…