Posts by Alisson Acioli • 5,815 points
323 posts
-
-2
votes2
answers236
viewsA: Class does not extend from another
Put a require_once in the code where you will give the extends <?php require_once("template.class.php"); class Spinxo extends Template { public function __construct() { $tpl = new Template; }…
phpanswered Alisson Acioli 5,815 -
3
votes1
answer978
viewsQ: Permission error while uploading file to Amazon server
I am trying to send some site changes to the client’s server on Amazon, only that by doing so it returns to me that I am not allowed to do so because the client’s website is not on /var/www/html and…
awsasked Alisson Acioli 5,815 -
0
votes1
answer1683
viewsQ: Calculate percentage between 2 numbers
I have to do a percentage system where I have 2 dates in TIMEUNIX, being the final date ($cota->ultimo_recebimento) and the current day I catch up with the function time() from PHP. I tried to do…
-
0
votes2
answers388
viewsA: Sending email via php does not work
Try: <?php $subject = "example"; //Assunto $from ='[email protected]'; //Email de quem está enviando $to ='[email protected]'; //Email de quem vai receber $message = "<!DOCTYPE html>…
-
0
votes2
answers866
viewsQ: Scroll bug when opening a modal on top of another
When I click on Menus link http://www.escolatarsiladoamaral.com.br/home (goes to the restricted area, login: admin and password: admin) it opens a modal usually, with the scrolling and everything,…
-
4
votes4
answers3915
viewsA: Knowing if there are blanks
Try <?php $username = trim($_POST["username"]); if(empty($username) || is_null($username)){ echo 'Preencha o seu username!'; }else{ echo 'Tudo OK'; } ?> The function trim clears left and right…
phpanswered Alisson Acioli 5,815 -
0
votes0
answers580
viewsQ: File not found when giving
I have an HTML form: <link rel="stylesheet" type="text/css" href="script/overlay-div/css/overlay-div.css"> <link rel="stylesheet" type="text/css" href="style/bootstrap.css"> <link…
-
2
votes2
answers57
viewsQ: Print next days after 18/01/2016
I have to make a code where I put a date and need to know what are the next 5 days. For example, today is day 18/01/2016 the next days are 19/01/2016, 20/01/2016, 21/01/2016, 22/01/2016 and…
-
1
votes1
answer47
viewsQ: Calculate quantity by the whole number
I have to enter a record in the database according to an integer number. For example, 20, 21, 22, 23...29 I take the first number (in case 2) and enter 2 records. If it is 10, 11, 12, 13...19 (in…
-
0
votes3
answers425
viewsA: Get the first 3 results in a query mysql_query
RESOLVED I found this solution: <?php $db = mysql_connect('localhost', 'root', 'vertrigo'); $bd = mysql_select_db('cotas', $db); $array = array(); function indicadores($id, $niveis){ global…
-
3
votes2
answers1421
viewsA: How to update link without refresh with javascript?
You’ll have to use jQuery. Use the function $.ajax(). I’ll give you a basic example <a href="javascript:void(0);" id="like_a" referencia="3" acao="like">Like</a> <script>…
-
2
votes3
answers425
viewsQ: Get the first 3 results in a query mysql_query
I’m retrieving data from the database that would be "The Nominee’s Indicator," only it takes them all until it recovers all. What I need to do is get only the first 3 results. And if I can indicate…
-
1
votes2
answers42
viewsA: problems with HTML and PHP + Mysql
Do it like this, your code will work: <div class="container"> <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12"> <section class="painel novidades"> <h2>Novidades</h2>…
-
0
votes1
answer1048
viewsQ: Change dimension to activate Nav-toggle before
I’m making a website and I’m using bootstrap in it. I tested it on my phone and when it shows the menu, the menu is still the same as on the PC only with the smaller source. I wanted to show that…
-
13
votes4
answers651
viewsA: display:One consumes data?
It is charged. If you see in Inspector de elemento You’ll see he’s there, just hiding with the display:none. A good example for you to see that it is loaded and consumes data, is you make a loop of…
-
0
votes3
answers485
viewsQ: Error inserting data into Mysql - Codeigniter
I have the code <?php $chave = $retorno->resposta->cobrancasGeradas->cliente->cobranca->chave; $this->db->insert('boletos', array('id_fatura'=>$id_fatura,…
-
3
votes3
answers2019
viewsA: Update total value with quantity
Use the jQuery <script type="text/javascript"> $(document).ready(function() { $("#ID_DA_QUANTIDADE").change(function() { var qtd = $(this).val(); var valor = $("#ID_DO_VALOR").val(); var…
-
1
votes1
answer114
viewsA: Turn 2600 into 26.00 in PHP?
Do the following: <?php $number = "15000"; echo number_format($number, 0, ',', '.'); ?> So he will return: 15,000
-
-5
votes1
answer114
viewsQ: Turn 2600 into 26.00 in PHP?
I will have values like 2600 or 15000 and need to put as 26.00, 150.00, etc. How can I do this in PHP ? With the function number_format it puts wrong (in my case) as 2600,00 or 15,000,00. How can I…
-
3
votes2
answers785
viewsA: How to persist $_SESSION value in <select> as it was done for <input>?
It’s the same way $_POST['nome'] only by changing the value. Try <?php if(isset($_POST)) { $_SESSION['nome'] = $_POST['nome']; $_SESSION['tipo'] = $_POST['tipo']; } Don’t forget to put…
-
3
votes1
answer814
viewsQ: Sort by number with Datatables
I’m having a problem with the plugin DataTables in order of numbers. I have a list of numbers: 1 2 3 4 ... 10 11 12 The problem happens because of the digits. It sorts type 1 10 11 12 2 3 4 ... The…
-
1
votes3
answers861
viewsA: Run php code within a variable
Use the function val(). I just saw this possibility also with this function. Hugs!
-
0
votes2
answers65
viewsA: Get records from 3 tables with JOIN
Solved I solved my question by making the command: SELECT u.nome, ( SELECT COALESCE(SUM( c.quantidade ), 0) AS qtd FROM cotas AS c WHERE c.id_user = u.id AND c.status =1 ) AS quantidade_cotas, (…
-
1
votes2
answers65
viewsQ: Get records from 3 tables with JOIN
I need to get data from 3 tables in the same SELECT. I just need to get user data from the table users, take the quantity of quotas (column quantity_quotas) that the user has of the table quotas (if…
-
6
votes5
answers1021
viewsQ: Pick first name with Regular Expression
I need to get the first name with regular expression, only I’m not getting it right. Today I use the code like this: <?php preg_match('/[[:alnum:]]+/i', 'Alisson Acioli', $matches); return…
-
0
votes2
answers51
viewsA: Pick up records that are there 3 days to win
Solved I used the following Mysql command: $hoje_tres = date('Y-m-d', strtotime('2015-12-28')+(60*60*24*3)); $query = $this->db->query("SELECT * FROM cotas WHERE…
-
0
votes2
answers51
viewsQ: Pick up records that are there 3 days to win
I have a table called cotas that has a column ultimo_recebimento, in that column is the date in the form of time of the day that will be the user’s last receipt. I need to get all the records that…
-
0
votes1
answer59
viewsQ: Formatting PHP values
I want to format a value that leaves the function rand() only it’s not the usual way. I have a rand(): <?php $valor = rand(3000,7000); echo number_format($valor, 2); ?> Output: 5000,00 I need…
phpasked Alisson Acioli 5,815 -
3
votes4
answers1125
viewsQ: Run PHP function to insert data into DB daily at specific times
I am creating a "module" of my system and now I have to create a function that, when arriving at the time that is in the database, run a insert. For example, if the schedule is in the table 22:00,…
-
0
votes3
answers408
viewsA: Error listing items from a foreach() array
SOLUTION I was able to fix it by defining the variable $bancos as global out of functions, before setting the variable value $bancos <?php global $bancos; //Isso que adicionei $bancos = array(…
-
4
votes3
answers408
viewsQ: Error listing items from a foreach() array
I have a array with the list of several Brazilian banks and need to take the name of the bank where the code according to what is in the user’s account, only when doing this search for code it…
-
4
votes2
answers1031
viewsQ: What’s the difference between bindValue and an array executed directly in $Pdo->execute()
Currently I use a schedule like this <?php $array = array('nome'=>'Alisson', 'idade'=>20); $query = $conn->prepare("INSERT INTO table (nome,idade) VALUES (:nome, :idade)");…
-
0
votes4
answers352
viewsQ: Error inserting json in Mysql with PHP
I have a code PHP which causes an array to become jSON <?php $imagens = array('imagem1.jpg', 'imagem2.jpg', 'imagem3.jpg'); $json = json_encode($imagens); $inserir = mysql_query("INSERT INTO…
-
1
votes1
answer1025
viewsA: Fatal error: Call to a Member Function result() on a non-object
This error is caused by your command line SQL that is in the variable $query. I have been through this problem several times until I get back to me if there was a line at least of this query. For…
-
0
votes2
answers758
viewsA: PHP Mysql avoid database registration in uppercase letters
An output is you make the title lower case. To do this use the function strtolower(): <?php require 'conexao1.php'; header ("Content-type: text/html; charset=utf-8"); $titulo =…
-
1
votes1
answer102
viewsA: Calling function in a controller from a parameter sent by the user in PHP
For you to do this is simple. Let’s create a controller called for example test and inside him do what you need: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class…
phpanswered Alisson Acioli 5,815 -
2
votes1
answer691
viewsA: Problem with Codeigniter error session
Well, I’m not sure if it’s the solution, but try to record session by session in your code. Always make sure you’re calling the library session on your controller or on your controller autoload.php.…
-
1
votes1
answer1230
viewsA: Warning: unlink(/): Permission denied
The problem is because the variable $nome will only be valid after a request POST of btnEnviar, that is, will only be valid in the block of IF if(isset($_POST['btnEnviar'])){ //linha 3 To make it…
phpanswered Alisson Acioli 5,815 -
0
votes1
answer889
viewsQ: Fixed div in browser footer
I’m needing to leave a div that would be a fixed "Buy" button in the browser footer. Leave it at the end of the monitor, and even if the scroll scrolls down, it remains in the same position at the…
-
2
votes1
answer80
viewsQ: Count records only if larger than the current datetime, with Count()
I have the following query: SELECT u.nome, u.email, u.login, u.data_cadastro, COUNT(*) AS qtd FROM patrocinadores AS p LEFT JOIN anuncios AS a ON a.id_user = p.id_user INNER JOIN usuarios AS u ON…
-
1
votes1
answer1867
viewsQ: explode() right on Mysql
I have a column called relacionados on the table produtos and there are some ID’s of some table items produtos. I needed to make a explode() or something like that on the table produtos and selects…
-
0
votes1
answer1051
viewsQ: Mysql returns NULL when you place SUM and there are no records
I have the code SQL SELECT SUM(r.quantity_domingo) AS quantity_domingo FROM reporters AS r INNER JOIN nucleos AS n ON r.id_nucleo = n.id INNER JOIN usuarios AS u ON n.id_user = u.id WHERE…
-
6
votes1
answer133
viewsQ: Dropdown with SVG
I have an art and now it’s in an SVG file. The problem is that the client wants that when passing the mouse (or if clicking) on a block, he should open a menu. I don’t know if you have the ability…
-
6
votes4
answers4991
viewsQ: Datatable does not order correctly
I’m using the plugin datatables to paginate results in a table. The problem is that the first column has 3 dates: 26/11/2015 19/11/2015 03/12/2015 I need to order the results of dataTables based on…
-
8
votes1
answer4160
viewsQ: Simulate click with jQuery after inserting link via jQuery
I have to open another tab with a link that is returned to from PHP to jQuery. I used window.open but he asks to release the popup and the client doesn’t like it at all. So I thought I’d do, when…
-
1
votes1
answer229
viewsQ: .htaccess directing everything from the URL to index.php
I took a panel to do maintenance and developed a new panel on codeigniter. After created, I created a folder on the server called Adm and played all the files there. The problem is that the root…
-
6
votes2
answers984
viewsQ: Codeigniter session expiring after an action
I made an administrative panel using CodeIgniter and every time the session is expiring, thus redirecting to the login screen. Every time for example, that I edit a category, after edited and click…
-
3
votes1
answer76
viewsA: PHP code not recognized on the page
Always use <?php at the beginning of a code PHP and end with ?>. For example, in the code you posted above the function that is called getMessage() is not between PHP tags. You have to always…
-
1
votes1
answer21
viewsQ: Image opacity tagged with MAP
I have this page: http://comunicacaointerage.com.br/paginas/DiskBanner/diskbanner.html In it, the image is tagged <area> to put link on each of the forms. The problem is that the service staff…
-
0
votes0
answers45
viewsQ: Submenu in tag "area"
I have to develop this element that is in the middle (rendondo) : I never developed such a shape in HTML/CSS, so I resorted to tag <map> and made the following code: <div align="center">…