Posts by Wees Smith • 2,778 points
154 posts
-
1
votes2
answers88
viewsA: Unrecognized keyword "as"
Would that be: SELECT c.`nome`, c.`cod_municipio`, cll.`latitude`, cll.`longitude`, c.`id_estado` as teste CASE teste WHEN 1 THEN 12 WHEN 2 THEN 27 WHEN 3 THEN 13 WHEN 4 THEN 16 WHEN 5 THEN 29 WHEN…
-
1
votes4
answers82
viewsA: How do I limit a text box?
Using the attributes of <textarea>: <textarea name="textarea" cols="10" rows="10" wrap="textarea"> cols -> number of columns Rows -> number of lines wrap -> word break Reference…
htmlanswered Wees Smith 2,778 -
0
votes1
answer2068
viewsA: Multiple PHP uploads and insert several images into the mysql database
The point is that the function implode() needs a array() and you were passing a string, try like this: $extensao = @end(explode('.', $name)); $nomes[]=$nomeUnico = rand().".$extensao"; After the…
-
0
votes1
answer26
viewsA: Problems with Json and php
Possibly because you are setting the array out of the loop while(), try like this: while( $row = mysqli_fetch_assoc($resultado_consulta) ) { $resultado[] = array( 'nome_cliente'…
-
0
votes2
answers962
viewsA: Change the site color in one click!
With Jquery: <button id="red">Vermelho</button> <button id="green">Verde</button> <button id="blue">Azul</button> <script type="text/javascript">…
-
0
votes3
answers1130
viewsA: Break line after IMG with CSS
An alternative is to put the text inside another tag <p>: <div class="modal-body"> <p> <img class="img-modal" src="view/img/acougue.png" align="left" style="margin-right:…
cssanswered Wees Smith 2,778 -
1
votes2
answers108
viewsA: formulario this with problem when recovering the Post value
To send the form to the same page there is no need to have the attribute action, consequently, the <script> tbm not: <?php if(isset($_POST)&&!empty($_POST)){ echo $_POST['link']; }…
-
1
votes1
answer210
viewsA: Code error to place watermark
The error is on your system’s redirect page from action of <form>: Should have the php at the end, according to the name of the document. <form method="POST" action="marcarpdf."…
-
0
votes1
answer82
viewsA: SELECT and INSERT - Inserting only the first data
The mistake is in instead of name must use value in both <select>: <option name="<?= $linha2['setor_id'] ?>"> <?= $linha2['setor'] ?> </option> But they may be: 1st…
-
0
votes1
answer134
viewsA: Error in Opencart purchase button
Error this one: data:$('#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\']:SELECTED=TRUE, #product input[type=\'checkbox\']:checked, #product select,…
-
-1
votes1
answer52
viewsA: What I need is to take the primary key from the Phone table and insert it into the FK of the Client table. How do I?
Making a INSERT with SELECT: INSERT INTO Cliente (fk_ID_Telefone) SELECT id_Telefone FROM Telefone But if it’s a UPDATE with SELECT: UPDATE Cliente a JOIN Telefone b SET…
-
0
votes2
answers169
viewsA: JSON Openload PHP
Using file_get_contens() and json_decode: <?php $json=file_get_contents('https://api.openload.co/1/file/info?file=6PHaY9bqRYc'); $json=json_decode($json); echo 'Status: '.$json->status; ?>…
-
2
votes3
answers68
viewsA: Problem in select order
You can use the array_reverse(): $count_vis = 0; while($r_sql_2_vis = mysqli_fetch_array($sql_2_vis)){…
-
1
votes2
answers196
viewsA: Error: Notice: Undefined index || PHP || MYSQL ||
A lock problem in the wrong place, every code should be inside the if(isset($_POST)&&!empty($_POST)): <?php if(isset($_POST)&&!empty($_POST)){ if ($_POST["d1"]<>""){…
-
1
votes1
answer30
viewsA: Error in ajax when sending the form
Missing information to be passed, try this alternative on Jquery: var data=new FormData(); data.append("foto",$("campo_da_foto")[0].files[0]); data.append("outras informações",$("outros…
jqueryanswered Wees Smith 2,778 -
0
votes1
answer47
viewsA: Help with Ajax and FORM Requests
Let’s make some changes to the $.ajax(): $.ajax({ url:"prod_index_consulta.php?buscar="+cod, dataType:'Json', success:function(data){ $('#visual').html(''); $.each(data,function(key,value){…
-
1
votes3
answers1237
viewsA: How to insert a new line in the json file, using PHP?
Counting the number of arrays within 'assigniment', as the function count() starts at 1, so it will always have a value greater than the last id, in your case: $id=count($json['assignment']);…
-
0
votes1
answer182
viewsA: Connect PHP with MS-Access
Go a bar between the $_SERVER and the file: $_SERVER["DOCUMENT_ROOT"] . "\_assets\db.accdb";
-
1
votes2
answers139
viewsA: print specific data of a json in php
Usually when not defined CURLOPT_SSL_VERIFYPPER, it’s usually a mistake, so with this code you can get the data: header("Content-Type: text/plain"); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,…
-
1
votes1
answer226
viewsA: Error: Notice: Undefined index: D1
The <select> was with the <option> valueless, use: <select class="form-control" name="ordenar"> <option value="referencia">Referencia</option> <option…
-
-1
votes2
answers103
viewsA: Loop in $_POST to save data to a file. CSV
I took the liberty and made some changes to the code: $error=$projeto=$quantidade=$altura=$largura=$material=$descricao=''; $sum_quantidade=0;//variavel da soma da quantidade function…
-
-1
votes2
answers86
viewsA: Ajax does not work when it comes from a form select
To catch the <option> selected: $('#sectionChooser option:selected').val();
-
1
votes1
answer914
viewsA: Select hide/show Divs according to the selected value (jquery)
Using a loop for() makes it easy: $("#1,#2,#3,#4").hide(); $("#numerounidades").change(function(){ var num = parseInt($('#numerounidades option:selected').val()); for (var i = 1; i <= num; i++) {…
-
3
votes3
answers282
viewsA: How to use a text selector in html?
To get the selected text you use the function getSelection(): Take the example: $('p').mouseup(function(){ var range = window.getSelection(); alert(range); }); <script…
-
1
votes1
answer55
viewsA: Reading array and saving with php
I turned the Answers array into a json for you to save in the database: public function saveResult($post) { $array = $post; foreach ($array['questionario'] as $value) { $iduser =…
phpanswered Wees Smith 2,778 -
0
votes2
answers257
viewsA: Infinite listing with mysqli_fetch_array()
$servidor = 'localhost'; $usuario = 'root'; $senha = ''; $banco = 'portfolio'; $COMANDO_SQL = "SELECT * FROM cliente"; $link = mysqli_connect($servidor,$usuario,$senha,$banco); $resultado_listagem =…
-
1
votes1
answer351
viewsA: Return all results of a query with mysqli_fetch_array
One solution I found for your problem is the following: You have the array() hours that have already been chosen as a query response through the mysqli_fetch_array(), which in the example I…
-
-1
votes1
answer72
viewsA: Problem passing some Json messages to Jquery
Within the if() that checks if the name is short, also goes a echo json_encode($res)
-
2
votes3
answers690
viewsA: Check whether html form numeric field has a maximum of 6 numbers with PHP
Using php you use the function strlen(), that counts the number of characters in the string: $str=strlen($_POST['sua_variável']); if($str==6){echo 'ok';}
-
1
votes1
answer460
viewsA: Button to insert new inputs into the form
Doing this in the Jquery you can add: $('.addtorre').click(function(){ $('form').append( '<input type="text" name="tipo[]">'+ '<input type="text" name="metragem[]">'+ '<input…
-
0
votes1
answer37
viewsA: Insert data if another INSERT is successfully executed
2nd INSERT only if the first happens: <?php require 'conexao.php'; $conexao = conexao::getInstance(); $acao = (isset($_POST['acao'])) ? $_POST['acao'] : ''; $numero = $_POST['numero']; $assunto =…
phpanswered Wees Smith 2,778 -
1
votes1
answer14
viewsA: Add fields on page as selected option in a select options menu
Create a new div inside the form-group, to receive the values, then using html() you add the values in this div: $(document).ready(function() { $( ".form-control" ).change(function(){ var varURL =…
jqueryanswered Wees Smith 2,778 -
0
votes2
answers367
viewsA: How do I put a select inside the while?
You can do it like this $sql=" SELECT Copia.id AS copia_id, Org.id, Org.nome FROM Organizacoes as Org INNER JOIN Organizacoes.Rel_Organizacoes as Grupo on Org.id = Grupo.id_Organizacao INNER JOIN…
-
1
votes1
answer55
viewsA: Consultation system
Creating the conditioning for the $nome relating to the dates: $inicio = $_POST['inicio']; $fim = $_POST['fim']; $nome = $_POST['nome']; if((empty($inicio))||(empty($fim))&&(empty($nome))){…
-
0
votes1
answer145
viewsA: Not getting user level from Session
You are defining the $_SESSION like the $nivel, and not the $nivel as the $_SESSION, it should be like this: session_start(); $nivel = $_SESSION['nivel']; if($nivel == 1 ){ include 'adm/menu2.php';…
-
0
votes4
answers1977
viewsA: Select All checkbox by clicking a checkbox
Change in input checkbox: <td><input type="checkbox" value='.$codigo.' name="check[]" class="check"/></td> In the Jquery: $('#checkMaster').click(function(){…
-
1
votes2
answers22
viewsA: Event onmousenter
That solves your problem Box-Sizing, only CSS: box-sizing: border-box; Since the building elements HTML are boxes, it should be considered that, the size of the box includes its edge, but it is not…
javascriptanswered Wees Smith 2,778 -
-1
votes1
answer70
viewsA: Registration in php
Has a ; remaining there: $sql = "INSERT INTO usuarios (usuario, senha) VALUES ('$g_user', '$g_pass');"; Replace with: $sql = "INSERT INTO usuarios (usuario, senha) VALUES ('$g_user', '$g_pass')";…
-
4
votes1
answer461
viewsA: Says it saves to mysql but not saved to the database
Syntax error $query = ("INSERT INTO mensal_anual (matricula) VALUES ('$matricula')"); IS VALUES and not VALUE
-
1
votes1
answer234
viewsA: Get value passed by Aria-Controls (Bootstrap tab panel)
Catch the aria-controls: $('li[role="presentation"] a').click(function(){ var aria_controls=$(this).attr('aria-controls'); //aqui você faz o ajax para enviar o valor para uma pagina php que fará o…
-
1
votes4
answers1248
viewsA: Help with exercise
You were calling the function within itself, and at the time of division did not make the sum before, check now if it is right: var module = function restaurantBill(bill) { /* 1. Crie uma variável…
javascriptanswered Wees Smith 2,778 -
1
votes1
answer148
viewsA: Success message when registering in BD
changed the variable name mensagem, which refers to the tag that will receive the message to campo_mensagem: // Quando carregado a página $(function ($) { // Quando enviado o formulário…
-
0
votes1
answer49
viewsA: go to the next div excluding another element
I added the data-slide in <div>s to make the interaction <div class="slider"> <div class="slide fade ativa" data-slide="1"> <img src="_img/_banner/_site/bg_1.jpg" />…
-
0
votes2
answers846
viewsA: Validate checkbox fields with Bootstrap Validator
Missed the data-toggle="validator" in the <form>, in your case at <div class="form-check"> It can also be done by Jquery using $('.form-check').validator();…
-
0
votes2
answers86
viewsA: Help with Ajax Requests to get BD data
In his url:"prod_index_marca.php?codmarca=<?php $res['codigo'];?>" must be url:"prod_index_marca.php?codmarca=<?php echo $res['codigo'];?>", is missing function echo()php. In the echo()…
-
3
votes2
answers195
viewsA: Input is "Cutting" what comes after space with PHP
Your value=<?php echo $Origem; ?> must be value="<?php echo $Origem; ?>"
-
1
votes1
answer166
viewsA: problem with listing items of this object
Uses a foreach() foreach($resultados->paymentOrders as $key => $value){ var_dump($value); //ou abstrai as informações $code[$key]=$value; }…
-
1
votes2
answers113
viewsA: How to use before in CSS?
Using a neutral tag you get the result: <h1>Titulo 1 <span></span></h1> .h1{ display: inline-block; position: relative; text-decoration: none; } .h1 span{ border: 3px solid…
-
3
votes2
answers1021
viewsA: Speaker responsiveness in Bootstrap
This is because the Bs grid uses left alignment, so it will really get image->text->text->image, but you can create a specific css class for these columns using @media{}, for example: These…
-
0
votes1
answer294
viewsA: Using Animations in a Carousel
creates a setInterval() calling the same function performed when you click the arrow: function slide(drop){ if (drop == 1) { $("#mega").show(2500); drop--; } else { $("#mega").hide(1000); drop++; }…
javascriptanswered Wees Smith 2,778