Posts by LocalHost • 3,256 points
106 posts
-
3
votes1
answer181
viewsA: Force redirect to HTTPS environment
Try to insert these lines : RewriteCond %{HTTPS} !=on RewriteRule ^ HTTPS://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
-
4
votes4
answers3460
viewsA: Take letters from name string
Try it like this: $string = 'Renan Rodrigues'; $nomeSeparado=explode(" ",$string); $iniciais= substr($nomeSeparado[0],0,1).substr($nomeSeparado[1],0,1); echo $iniciais;…
-
1
votes4
answers10528
viewsA: Contact form with AJAX without refresh
That would be it. You only need to include the jquery file if you haven’t used it yet. <form name="contactform" method="post" action="sendemail.php"> Nome: <input type="text" name="nome"…
-
3
votes2
answers114
viewsA: How to mark/deselect a link on a page by clicking on next/back?
I did it with jquery, and commented on the code. That would be? // ao clicar na seta de voltar $("#voltar").on('click',function(){ //pega o conteudo do <a> que esta atualmente ativo var…
javascriptanswered LocalHost 3,256 -
3
votes2
answers338
viewsA: Background does not work
What’s happening is that the background is working, but your div is not following the content inside it, so in css add: display: table; .background-1 { background:…
-
2
votes0
answers237
viewsQ: How to load css files asynchronously?
Well, I put the link to my website, to be analyzed on Pagespeed and to fix optimization issues and etc.. And for the javascript, was pointed out that it needed to be corrected Delete rendering lock…
-
2
votes2
answers77
viewsA: PHP comparison does not work
You just missed there in the condition if($aceitos > 0 AND $aceitos < 61) { echo "Validos apenas números de 1 a 60"; } In this condition, it would be the numbers that would be accepted, in the…
-
1
votes1
answer1696
viewsA: how to call the file function . js
You can use two alternatives, or the relative path, which is relative to the current file. So if this is the location of your index : raiz/views/home/ then the path to your js file, would be…
-
3
votes2
answers207
viewsA: When start the site already ask login
Well, if I understand correctly, you will have to put in the first lines of the code, which needs the login, the instruction requiring the login, and for that it needs to be .php. So the first step…
-
7
votes1
answer407
viewsA: Replace anchor by form button with calculation by javascript
I believe that if I understand correctly, just put a button of type not Ubmit, not to send the form and reload the page without you see the result! function calc(){ var form =…
-
7
votes2
answers3233
viewsA: How to calculate parcels (R$) and fill in inputs?
I made a function here to generate the value of parcels and inputs, run ai. I hope to have helped. I commented the code, any doubts comment ai!! //Funcao para atualizar as parcelas e seus valores…
-
3
votes1
answer41
viewsA: Not printing my selected checkbox
You have only "vectorized" your inputs, as you used the same name, and then want to recover the value of all, needs to be this way: <form method="post" action="form.php"> <input…
-
0
votes2
answers71
viewsA: Problems with number_format(PHP) by two points in the numeral
Tell you what, that would be it?: substr(str_replace('.','','1.235.32'),0,strlen(str_replace('.','','1.235.32'))-2).".".substr('1.235.32',-2); Half a gabiarra but I think that’s it... I hope I’ve…
-
7
votes1
answer307
viewsQ: Convert Excel (.xls) to (.htm)?
I made a system for a school, where from the Excel file, where are stored all school newsletters, I export to .htm, where it generates some files with this extension and from there I can cut the…
-
2
votes2
answers300
viewsA: Is it possible to do this effect with CSS?
Well, I don’t know how to twist it and I don’t know if it’s possible, but the closest I’ve come is this: .img{ height:320px; animation: 3s movimenta infinite;} @keyframes movimenta{ 0%{…
-
2
votes2
answers1021
viewsA: horizontal alignment with css
Is that it? I tagged it <a> and the icon and title within it. And in css, I added the following line .card-red-head i{ margin-top:-4px;float:left; }. That in the case formats the positioning…
-
5
votes3
answers4512
viewsA: How to pass the value of a variable to an Hidden input?
It would be good if you put some code but basically with jquery would be like this: $("#botao").click(function(){ var minhaVariavel="valor"; alert("Antes de atribuir o…
javascriptanswered LocalHost 3,256 -
0
votes0
answers26
viewsQ: Sending to the database a series of data accumulated during the day, is it possible?
I came to a question, to store data of events and browsing that the user performs on the site, would it be possible to only send to the bank after the end of the day, the actions that users have…
-
2
votes1
answer39
viewsA: Display certain image for derminated numbers
I believe this code solves your problem. By loading the page it takes the value of the input and compares according to what Oce said. And assigning the image: <input class="form-control"…
-
1
votes3
answers2052
viewsA: How to avoid repeating html code?
You can save to different files. This makes the code cleaner, readable and faster in case of later editions, of course if used correctly. A beautiful example is if all pages have the same footer and…
-
1
votes2
answers221
viewsA: Error in CRUD UPDATE command - java.sql.Sqlexception: No value specified for Parameter 8
Well, it’s been a while since I programmed in java, but I believe your mistake is here: StringBuilder sql = new StringBuilder(); sql.append("UPDATE cliente"); sql.append("SET codigo = ? , nome = ? ,…
-
3
votes1
answer70
viewsQ: When relating two tables, is the correct one on the SQL side, PHP or whatever?
I have this doubt of what is preferred to do when I need data from the two tables to get the result. I always did the comparison in PHP, but I learned the SQL relationship commands that could help.…
-
2
votes1
answer72
viewsA: Problem with margin-top css
Is that it? If it is, I’ll explain it better... .form-group { margin-bottom: 20px; position: relative; display: flex; height: 45px; float: left; } .control-label { opacity: 0.4; pointer-events:…
-
1
votes1
answer1297
viewsA: Fill in PHP session via ajax
If in your file you only have this code: $id = $_POST['botao']; $texto = $_POST['selecao']; $_SESSION["condicaoRegional"] = $texto; You are missing a start to the session before you can use it. Do…
-
4
votes1
answer722
viewsA: How to make a login system on the same page?
Well from what I understand, your question is how to make the same page a different page for the situation of being logged in and another when it is not. First start with checking whether the user…
-
2
votes2
answers520
viewsA: encoding php to mysql database
Well, if you use mysql, you can encode by making the following foma in your database connection file: mysqli_query($link,"SET NAMES 'utf8'"); mysqli_query($link,'SET character_set_connection=utf8');…
-
0
votes1
answer141
viewsA: Warning: Pdostatement::execute(): SQLSTATE[HY093]
Missed passing Where’s ID. $stmt->bindParam(':observacao', $observacao); $stmt->bindParam(':id', $_GET['id']);
-
1
votes2
answers1518
viewsA: API of Mercadopago
Good first you must pass the data from your cart to the way the marketPago asks. <?php foreach($_SESSION['carrinho'] as $produto){ $_SESSION['items']['title']=$produto['Produto'];…
-
1
votes2
answers4673
viewsA: Hide/Show when checkbox is checked or unchecked
I made a quick code here, that would be it? <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <label> <input type="checkbox" name="check"…
-
0
votes1
answer36
viewsA: Help me with the jQuery
Your code had some errors there in the click function $('#mais').click(function(e)){ You closed two parentheses instead of one, because this already closed there at the end. And what was missing…
-
0
votes3
answers1789
viewsA: Pagseguro notifications: Unable to resend the notification
I’ll put my notification code here, I don’t know how your... But as mine is working recording in the bank, maybe this can help you. Ai comments here any doubt. In this code below, it is the file…
-
0
votes3
answers4380
viewsA: Html + Css FAQ creation
I think if I understand your question, I’ll give you some references. I advise the bootstrap, because if it is starting yet, I advise getting something ready to then risk doing from scratch. Here is…
-
2
votes2
answers102
views -
4
votes1
answer217
viewsA: Select multiple inputs
You can use not by deleting the element you do not want to apply the same rule in your case would look like this: #form-login input:not([type="submit"]){ background-color:#000;} The not selector is…
-
-2
votes2
answers161
viewsA: Popular PHP dropdown error with array
Try to put $redesBanco[0]. Since you are trying to echo an array, it is recommended to var_dump to see the structure to write for example, <?php echo "<a…
-
0
votes1
answer150
viewsQ: How to get the text of the line where the cursor is positioned?
I have a textbox, and I need to get the content of the line where the cursor is positioned. For example, I am in the third line of the textbox (cursor positioned on it), I would like to get the…
-
3
votes2
answers1458
viewsA: Limit the size of an array
I think if I understood it is very easy, just take the array and put the position (index) that you want. Example: <?php $primeiro=$array[0]; //Ribossomo $segundo=$array[1];//Silva ?> By your…
-
5
votes3
answers219
views -
0
votes2
answers661
viewsA: Return jtable line information after selection
If you are using the Abstracttablemodel based on the class... First, when calling the second screen, create a method on the second screen that you receive from where it came from. type, have Jframe1…
-
0
votes2
answers419
viewsA: Doubt with php database connection with mysql
It’s better for organization, and the like, for when someone other than you can understand more easily. And when you transfer to an online server, you don’t have to look for where you connected to…
-
0
votes1
answer73
viewsA: Select mysql GROUP BY
If I understood well, you can do so "SELECT * FROM bet WHERE code=XX LIMIT 1" Here is;e will return the bet of those who have the same code, but I did not understand well if it will have an extra…
-
0
votes2
answers671
viewsA: CHANGE PHP STATUS
First a brief comment on security, since it is using PDO and prepare... it is recommended that you pass the variables directly in the query... $atualizarstatus = $pdo->prepare("UPDATE usuario SET…
-
2
votes2
answers579
viewsA: Receive real time variable ajax
Good here would be an example of sending data by ajax $.ajax({ var dado= "algumas coisa que queira enviar"; url: "recebe.php", type: 'POST', data: dado, success: function (data) {…
-
1
votes1
answer30
viewsA: Updating session ID for added security
It will not overload no, only if you have like thousands, or millions or a little more than that of kk pages, otherwise it will not influence so much in the server
-
1
votes2
answers53
viewsA: INSERT times do not insert all data
I’m not sure what’s going wrong, but I can point to a possible solution. Try to place the fields of the table you are entering in the query.... type like this. $insert = mysqli_query($conn,"INSERT…
-
1
votes1
answer207
viewsA: When I click the button more than 1 time the count accelerates
Well, I solved it like this. I know it’s not the best way possible, but it’s a hiccup. As the colleague said, he’s not getting the boot with this. Then I put the id of the button, it is passed to…
-
1
votes1
answer1940
viewsA: Real-time password verification with javascript and html
You can put something like, I don’t remember very well how it does, because it had done with jquery. But anything if it doesn’t work, I edit it right here. Blz? It also has some codes ready that…
-
1
votes1
answer200
viewsQ: Is it possible to select a table column without entering its name in SQL?
So I was researching but I couldn’t find anything about it, but I need to sort of select the first and second column of the table, without knowing what they are. My code is this: <?php…
-
1
votes1
answer904
viewsA: Bring Selected based on database values
You want to bring selected the option that is registered? And which table is registered this? us more information about the table... But from what I understood, the logic would be to do something…
-
9
votes2
answers742
viewsQ: Is it possible to integrate Paypal into my website without the user logging in or creating an account?
I was looking for and reading about it, but what I see is only put the pay button with Paypal, which requires who is buying to login to Paypal. Is there any way to do this, some example code light?…