Posts by Sr. André Baill • 6,946 points
384 posts
-
0
votes1
answer59
viewsQ: SQL JOIN - Build according to base
I would like to elaborate an SQL using LEFT JOIN. I wrote this SQL, but it didn’t work: SELECT *, p.parametro AS cidade, cpr.codTipo AS tipoAcompanhante FROM cadastroperfil AS cp,…
sqlasked Sr. André Baill 6,946 -
0
votes1
answer794
viewsA: friendly urls for various folders
You can work your htaccess this way: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] Later you can also use…
-
1
votes1
answer47
viewsQ: Run jQuery to select Requester
I got the following jQuery: function clienteChange() { var id = $('#idCliente').val(); $.ajax( { url:"/Administrar/clientes.endereco.php?id=" + id, dataType : 'json', success:function(result) {…
-
1
votes1
answer181
viewsQ: Align Divs Correctly
Hi, I have the following CSS .control-label{ width: 100px; text-align: center; } .input-mini { width: 85px; } And the following form structure <div class="control-group"> <div…
-
1
votes1
answer132
viewsA: Update mysql table with image
The error is in the image path... So do it this way: <?php $buscartexto = $pdo->prepare("SELECT * FROM institucional WHERE id =:id"); $buscartexto->bindValue(":id", $id);…
-
0
votes2
answers68
viewsA: Link after uploading a file
<?php $output_dir = "uploads/"; if(isset($_FILES["myfile"])) { //Filter the file types , if you want. if ($_FILES["myfile"]["error"] > 0) { echo…
-
5
votes1
answer9931
viewsA: Select like (2 different parameters)
You can elaborate your SQL this way: SELECT * FROM volkswagen_base WHERE link LIKE '%gol%' OR link LIKE '%kombi%'
-
2
votes2
answers1128
viewsA: How to concatenate php variable to pass as parameter
You can use the " " to interlink the quotes, so the concatenation is done: $aretorno["tabela"] .= "<td align=\"center\"><button type=\"button\" class=\"close\" aria-hidden=\"true\"…
phpanswered Sr. André Baill 6,946 -
3
votes3
answers1735
viewsA: How to use if/Else within a function?
You can do it this way: function mudarSexo($sexo){ switch($sexo){ default: $mudanca = 'Sexo não selecionado'; break; case 'masculino': $mudanca = 'Senhor'; break; case 'feminino': $mudanca =…
-
2
votes2
answers600
viewsA: Highlight term searched in bold with or without accent
You can try developing using the function strripos: $termo_pesquisa = 'ababcd'; $buscar = 'ab'; $pesquisar = strripos($termo_pesquisa, $buscar); if ($pesquisar === false) { echo "Sinto muito, nós…
-
1
votes1
answer122
viewsQ: Recover ID passed by DIV on next page
I have the following CSS class along with foreach(): <section id="cidades"> <div class="listacidade">ESCOLHA UMA OPÇÃO</div> <ul id="ListandoCidades"> <? foreach($cidades…
-
1
votes1
answer227
viewsQ: Passing variable for $_POST
I got the following foreach() <? foreach($cidades as $valor){ ?> <div class="listacidade"><a href="<? echo…
codeigniterasked Sr. André Baill 6,946 -
2
votes2
answers131
viewsQ: Div disturbs the Link
I have the following Divs: <section id="cidades"> <div class="listacidade">ESCOLHA UMA OPÇÃO</div> <div class="listacidade"><a href="../zz"><img src="<? echo…
cssasked Sr. André Baill 6,946 -
2
votes1
answer825
viewsQ: Redirecting in Codeigniter
I’m developing a project using the framework codeigniter. In the index which renders the site, I would like to first direct to a folder called 'input', and when clicking on a link in this folder,…
codeigniterasked Sr. André Baill 6,946 -
2
votes1
answer92
viewsQ: Escapeshellarg() error
When I try to upload, the following error appears: A PHP Error was encountered Severity: Warning Message: escapeshellarg() has been disabled for security reasons I’m using the framework CodeIgniter.…
phpasked Sr. André Baill 6,946 -
0
votes2
answers74
viewsA: Problems with the user profile
You can elaborate as follows: <?php session_start(); mysql_connect("localhost", "root", "angola") or die("cannot connect"); mysql_select_db("login_senha"); $login = $_SESSION['login_usuario'];…
phpanswered Sr. André Baill 6,946 -
1
votes2
answers304
viewsA: Php preg_replace replace src image
I don’t know if it would help you, but you can try it this way, maybe it would be a solution... As I didn’t quite understand how you would like it, and if the url comes from some string but if you…
-
5
votes3
answers242
viewsA: PHP error - Empty() function
At Rray’s suggestion, I did it this way: $periodo = $this->input->post('periodo'); $dataInicial = $this->input->post('dataInicial'); $dataFinal = $this->input->post('dataFinal');…
-
7
votes3
answers242
viewsQ: PHP error - Empty() function
I have the following mistake: Fatal error: Can't use method return value in write context in /home/username/public_html/Administrar/application/controllers/holerites.php on line 29 Follow the…
-
1
votes1
answer55
viewsA: Problems with login
Try to elaborate as follows: session_start(); $db = mysql_connect("localhost", "root", "angola") or die("cannot connect"); $con= mysql_select_db("login_senha"); $login = $_POST['login']; $senha_post…
phpanswered Sr. André Baill 6,946 -
2
votes2
answers649
viewsA: Doubt with the use of placeholder and onfocus in HTML
You can use the same placeholder to elaborate this, when you type it some, when you remove the writing, returns the placeholder. Follow the example. In this example of mine, you can change the color…
-
0
votes1
answer79
viewsA: Data check
Write the main PHP script this way: if(!empty($_POST['cadastra'])){ if(!empty($_POST['email'])){ $email = $_POST['email']; $ip = $_SERVER['REMOTE_ADDR']; $pegaEmail = mysql_query("SELECT * FROM…
-
1
votes1
answer53
viewsA: Selecting subcategory by category
You can proceed as follows, With this, you will be able to fetch everyone from this category: SELECT * FROM sub_categories WHERE categorie_id = '{$id_categoria}' But also you can elaborate as…
-
8
votes1
answer3424
viewsA: How to rank with PHP
Elaborate as follows: <? #Pontuação function coresPts($posicao){ switch($posicao){ case 0: $cor = "#FFCC00"; break; case 1: $cor = "#000000"; break; case 2: $cor = "#CCCCCCC"; break; } return…
-
0
votes2
answers63
viewsA: HTACCESS - External File
I worked it out this way and it worked! RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L]
htaccessanswered Sr. André Baill 6,946 -
0
votes2
answers63
viewsQ: HTACCESS - External File
I have a file . htaccess, but if I have a file outside the folder, it does not allow me access... And I would like you to allow: RewriteEngine on RewriteCond $1…
htaccessasked Sr. André Baill 6,946 -
8
votes1
answer15283
viewsA: Check if the completed email already exists in the database without refresh
Here is the solution with the help of @rray. checkEmail.html <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <input type='text'…
-
5
votes1
answer15283
viewsQ: Check if the completed email already exists in the database without refresh
I need you to fill an email in the email field, search the database and return a message warning if this email is already registered in the database. We developed jQuery + PHP according to answers…
-
5
votes2
answers3753
viewsQ: Check if the login exists in jQuery before submitting the form
I need to develop a system in which when filling the customer’s registration, is verified if the registered email already exists in the database, and if it already exists, that informs the user (via…
-
4
votes4
answers3288
viewsA: Select with redirection
Hello, you can do as follows: Create a javascript. Javascript <script> function AbrirSecao(secao){ window.open(""+secao+"", "_parent"); } </script> HTML <select name="unidade"…
-
0
votes1
answer55
viewsA: When you don’t have news
Do it this way: <?php $news8 = mysql_query("SELECT * FROM 10cms_noticias WHERE status = 'Ativo' ORDER BY ID DESC LIMIT 8") or die(mysql_error()); ?> <?php if(mysql_num_rows($news8)>0){…
-
2
votes1
answer204
viewsQ: Find Modules according to Permissions
I designed a function that lists all modules and sub-modules within the system. But I need it to be different, I need that in this same listing, only come the modules and submodules that the…
-
2
votes1
answer72
viewsQ: Generate these Results in PHP Mysql
I wonder how this kind of result is generated... How it is formatted this way. Mes/Ano | Vencidos | A Vencer | Vencendo 01/2015 | 5 | 0 | 0 02/2015 | 1 | 0 | 0 04/2015 | 15 | 0 | 0 06/2015 | 7 | 0 |…
-
3
votes1
answer47
viewsA: Variable in SQL query
Elaborate as follows: $model = $_REQUEST['model']; $customer = $_REQUEST['customer']; $consulta = "SELECT * FROM sistema WHERE concluido <> 1 AND site = '{$site}' AND {$model} = 'X'"; Do not…
-
2
votes1
answer37
viewsA: Insertion of IMG in Mysql
Change this line: $sqlUltimoID = $database::query("SELECT * FROM produtos ORDER BY id LIMIT 0 , 1"); $rowUltimoID = $database::row($sqlUltimoID); To: $sqlUltimoID = $database::query("SELECT * FROM…
-
0
votes0
answers40
viewsQ: Permissions of Modules
I have this class but at the time of comparing if there is this permission inside the return of the array, it appears that it has none. The permission is listed within the array. class Permission{…
-
3
votes1
answer226
viewsQ: Extend new CI class
I have the following code: class MY_Controller extends CI_Controller { function __construct() { parent::__construct(); } } I need to build a class where I do the Ci_controller extension, so I don’t…
-
3
votes1
answer27
viewsA: Mysql insert with "Link" between inserts
You need to leave out the first Insert, and inside the is yes put the image Insert... otherwise it will repeat various product Inserts. if(isset($_POST['submitProduto'])){ //Caminho para salvar…
-
4
votes2
answers8654
viewsA: Compare Date within Mysql
You can develop as follows: $DataAtual = date("Y-m-d"); $sql = "SELECT * FROM tabela WHERE data > {$DataAtual}"; This way it looks for records that are larger than the current date. Or if $data…
-
6
votes2
answers4670
viewsA: Posting system - "Duplicate entry '0' for key 'PRIMARY"
In the database you must use the auto_increment in the main ID. In order to add a new record, it already adds a new id to this record. ALTER TABLE `suatabela` CHANGE `id` `id` INT(10) NOT NULL…
-
2
votes2
answers129
viewsA: Define css with php according to the browser
You can search the useragent, and check the browser, and based on that, you can then set your css. Follow the example: if (preg_match('|MSIE ([0-9].[0-9]{1,2})|',$useragent,$matched)) { $css =…
-
1
votes2
answers956
viewsA: Value Radio Button does not pass via php Post
I worked as an example: I believe this will solve your problem. However, make sure $_POST is coming correctly from your form. PHP code #Verificação do Tipo de Faturamento function…
phpanswered Sr. André Baill 6,946 -
3
votes1
answer4157
viewsA: Change color of a <td></td> of the html table according to php condition
Good night. Made the connection to the database and the listing of all records, we call the function completPayment() to control the background colors of the CSS. Listing with the mentioned…
-
2
votes1
answer712
viewsA: How to place the title of the HTML page according to the user name in the database?
When logging in in php, register your user name in SESSION. Logged in to php, please: <?php session_start(); ?> <!DOCTYPE html> <html> <head> <title> <?php echo…
-
1
votes0
answers281
viewsQ: Return table data parameters, even if $query result is 0
Good evening: I am developing a project that consists of all parameters in a table of parameters... However, in my SQL it only works with records above 0: Follow the code public function…
-
3
votes2
answers199
viewsA: Compare the results
I made the following example: See if it helps you. PHP code <? if(isset($_POST['pergunta'])){ if(!empty($_POST['pergunta'][0])){ echo "<strong>Idade:</strong>…
-
1
votes2
answers606
viewsQ: Select category and subcategory within the same table
I have the table called modulos Inside it I include idModule, idModuloBase, module, folder and dating creation When the idModuloBase is 0, it is the category, if it is > 0, it is the completed…
-
2
votes1
answer606
viewsA: User control with PHP permissions
Develop the solution as follows: Have a table of modules... when registering the user, select which modules it has permission and save everything in an auxiliary table, then just retrieve the…
-
0
votes2
answers655
viewsA: Brazilian Army Scheduling System
Draw up the foreach in this way: The way you did it, it’s duplicated... you can pass a single parameter. foreach($_POST as $key){ echo "{$key->dia} - {$key->opcao}"; }…
phpanswered Sr. André Baill 6,946 -
2
votes5
answers3255
viewsA: Carrousel in php and mysql
Try this way: $conexao = mysqli_connect("localhost","root","","saber"); mysqli_set_charset($conexao,"utf-8"); $result = mysqli_query($conexao,"select * from banners"); $contador = 0;…