Posts by I_like_trains • 1,430 points
113 posts
-
3
votes2
answers194
viewsQ: Remove text within a comment tag with PHP?
My client usually does copy/Paste of news providers that contain HTML comments. That is, HTML does not hurt and when inserting they do not appear in the text editor but I use the PHP mailer that…
phpasked I_like_trains 1,430 -
3
votes1
answer89
viewsQ: Remove images that are not present in the database
I started working on a site already made by a former programmer who has a page inserting and removing images. However, when it removes, it only takes it out of the database leaving the image there,…
-
1
votes2
answers29
viewsA: Insert Event date into a table if page width is less than a given value
Try to do so var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; if(width < 39.9375){ //Valor em pixeis…
-
0
votes1
answer224
viewsA: Onesignal + PHP (App Notification)
According to the documentation You should use the id of the user present in the application in the menu Users > All Users. For example, you want to send the notification to the player with the…
-
0
votes5
answers1890
viewsA: Receive and read array coming by Ajax
Well, I kind of got what I wanted to do. while($mostra=mysqli_fetch_assoc($query)){ $array[] = $mostra['nome']; } foreach($array as $value){ echo $value.","; } With this code it creates a string…
-
-1
votes5
answers1890
viewsQ: Receive and read array coming by Ajax
I have a requisition ajax thus $.ajax({ type: "POST", data: "valor="+val, url: "ajax/mostra_imagens.php", success: function(e){ console.log(e); } }); On the page mostra_imagens.php he creates a…
-
0
votes0
answers27
viewsQ: Fetch names from all files in a folder?
I have a code made to fetch images but it’s a little more complicated than that. $("#publi_not").change(function(){ var p = 0; var r = 1; var val = $(this).val(); var valor = $('#publi_not…
-
1
votes2
answers41
viewsA: Having products from the database
You must do so <?php $db=mysqli_connect(bla, bla, bla, bla); //Campos da ligação $query=mysqli_query($db, "SELECT * FROM tabela"); //Caso use mysqli while($mostra=mysqli_fetch_assoc($query)){…
-
1
votes2
answers29
viewsQ: Difficulty finding values in an array
The following code is an increment code in an array. However, I haven’t been able to select any array value. If so print_r in it, it shows all but if I try to access with $guarda_array[1] he returns…
-
3
votes2
answers351
viewsA: Insert image.jpg in the database
If you just want the name, why don’t you use it like this? $nome_img = $_FILES['imagem']['name']; if(move_uploaded_file($_FILES['imagem']['tmp_name'], "images/".$nome_img)){…
-
3
votes2
answers1373
viewsQ: Ajax request to return Forbidden error 403?
I have the following code on my website. setInterval(function(){ var id = $("#id_radio").val(); var id_glob; $.ajax({ type: "POST", url: "ajax/update_radio.php", data: "id="+id, success:function(e){…
-
1
votes1
answer34
viewsQ: Error sending form by POST
I am experiencing a strange error. It is not really an error because the form sends the form but it changes one of the fields to 0 or 1. Here is the code. <form method="POST"…
phpasked I_like_trains 1,430 -
0
votes3
answers386
viewsA: I can’t align a form to the right
You are using the text-align wrong. You have to use text-align: right; or else float:right; Behold Here the documentation of text-align and Here the documentation of float…
-
2
votes2
answers195
viewsA: Compare current time to time recorded in the database?
I did it in a way that I did it alone. First I looped through all the data in the table and proceeded to compare hours. $select = mysqli_query($db, "SELECT * FROM programas");…
phpanswered I_like_trains 1,430 -
1
votes2
answers195
viewsQ: Compare current time to time recorded in the database?
I have an hour registered in the database and would like to compare it with the current time. How should I do it with PHP? The reason for this is that I needed to select a value that was available…
phpasked I_like_trains 1,430 -
1
votes2
answers64
viewsA: Send e-mail without finalizing the form
Can use AJAX, which is a mixture of PHP and JQUERY. Here’s an example $(".enviar_email").click(function(){ //botão para enviar var nome = $(this).attr("data-nome "); //variaveis var id =…
-
2
votes2
answers502
viewsA: Configure Onesignal PHP API URL
From what I have in my code, it’s working like this $fields = array( 'app_id' => "APP_ID", 'included_segments' => array('All'), 'headings' => $headings, 'url' => "url_a_enviar", 'data'…
-
2
votes2
answers230
viewsA: How to put the boostrap menu in the middle of the screen?
Where is the list of menus, if you go to see the source code see that the ul has margin-right:auto !important, ie, it will touch to the left side. Then just add a style with the following code.…
-
1
votes1
answer119
viewsQ: View available disk space in PHP on a web server
I tried to fetch the available space on the disk but it gets a lush number (124GB transformed) while it only has 12GB free. Here’s what I used. <?php $bytes = disk_free_space("."); $si_prefix =…
phpasked I_like_trains 1,430 -
0
votes2
answers31
viewsA: Problems recording and solving the calculation
I think the problem is here $adpo = $peso\$alt2;. If you’re making a division you should use / and not \ then I would be $adpo = $peso/$alt2;…
-
5
votes5
answers223
viewsA: Sum of hours greater than 24 hours
Well, first you can take only the hours and minutes, then add up $tempo="18:40"; $tempo2="08:30"; $minutos1=substr($tempo, 3, 2); $minutos2=substr($tempo2, 3, 2);…
-
1
votes3
answers478
viewsA: How to center a text in the middle of the page?
Another hypothesis was within the div with the class="col-md-10" had the following style <div class="col-md-10" style="margin:0 auto;text-align:center;">…
-
1
votes2
answers4177
viewsA: How does hierarchy elements work in css?
In CSS, the priority is thus First comes any line of css that has !important, that will always come first The second factor is the Inline Styles or Estilos em Linha which are those edited on the…
-
0
votes1
answer168
viewsA: Replicate sidebar on all HTML pages
From what I’ve seen you wear PHP on their pages. Here’s what you can do Create a file php called sidebar.php Paste the sidebar code into that file Do require "sidebar.php"; where the sidebar on your…
-
8
votes2
answers471
viewsA: How to line break a PHP string within a div
Use the word-wrap: break-word in the css of the div you want, like this: div { word-wrap: break-word; } Explanation of w3schools…
-
1
votes1
answer66
viewsQ: Onesignal requesting URL with APP_ID from SDK?
I’m using the code of OneSignal and I am not able to subscribe to users, because by accepting, it gives an error A bad HTTP response code (403) was received when fetching the script.. He’ll get the…
onesignalasked I_like_trains 1,430 -
1
votes0
answers20
viewsQ: Website doesn’t open with https on the phone?
Something that occurred to me recently was to search the website that I’m doing on Google, however, when I enter the link presented in the survey, it does not redirect to the site with https while…
-
0
votes2
answers625
viewsA: Button to delete Fullcalendar events - Celke
If you’re familiar with Jquery, I’m not sure how you have the code but you can try it like this The tag <a> should have a id, kind of: <a href="deletar_inscricao.php" id="tag_a_alterar">…
-
0
votes1
answer156
viewsQ: Display all the awesome font icons on my website?
I wish I could use all the icons from font-awesome 4.7 in my website without having to write the code of each icon. I’m not talking about iframe because I want to use Jquery events in them.…
font-awesomeasked I_like_trains 1,430 -
1
votes1
answer93
viewsQ: "Bug" in slideshow if staying too long outside the tab
I made a slideshow root with Jquery using setInterval to change the slides after a few seconds. It works fine, however, if I change tab and after some time come back, the animation gets "bugged" and…
jqueryasked I_like_trains 1,430 -
1
votes1
answer36
viewsA: PHP code is not recognizing HTML
Your for is poorly structured. You are wearing braces { } inves de parentheses ( ). for{$inicio=1;$inicio<=10;$inicio++}{ echo "<option>$inicio</option>"; } In other words, the code…
phpanswered I_like_trains 1,430 -
1
votes1
answer578
viewsA: Placing a website inside another as light box checkout
I tried it in a way that maybe works but I’m not sure it will work 100% because certain plugins might not load <div id="load"></div> $(document).ready(function(){…
javascriptanswered I_like_trains 1,430 -
0
votes1
answer36
viewsQ: Hide Ivs when mouse is out?
I have a code so structured <?php $p=0; $delay=0; while($p<=16){ $p++; $delay+=0.2; ?> <div class="column wow fadeInDown" onmouseout="outside(<?=$p; ?>)"…
-
-1
votes3
answers108
viewsA: Problem in centering images
To center the images Horizontally and Vertically can do just as in this example. With transform: translate(-50%,-50%) will center both horizontally and vertically. The field left and top have to be…
-
0
votes1
answer100
viewsQ: Failed to send email with phpmailer
I use the PHPMAILER on another site of mine where it is working perfectly. However, that same code does not allow me to send emails, it gives Sucesso and no error appears. I used the code…
phpmailerasked I_like_trains 1,430 -
0
votes1
answer22
viewsQ: Center an image that’s too big for the screen?
I have an image that has a height of 100%. However, the width exceeds the lateral limits and the image is cut on the right side and I would like to center it to cut equally on both sides. Here is a…
cssasked I_like_trains 1,430 -
2
votes1
answer145
viewsA: Put footer floating on another div
If you want the footer is above the div with id #gmaps, recommend using these css in footer footer{ width:100%; position: fixed; bottom: 0; } With this code, you can put the footer above…
-
1
votes3
answers198
viewsA: CSS Color beyond element size
Since you mentioned that the problem is the margins do the following .aside { margin-left: 0px; margin-top: 0px; padding-left:10px; padding-top:10px; display: block; background-color: rgb(58, 73,…
-
0
votes1
answer32
viewsA: How to save variables generated with Jquery in php?
My question was to take the values with the name iframe with $_POST['iframe'] because everyone had that name. My solution was based on keeping them in a array putting inputs like this: <input…
-
0
votes1
answer32
viewsQ: How to save variables generated with Jquery in php?
I have a button that adds inputs onclick and I would like to be able to save or effect the desired code in some for for entry into the database. This is the code onclick…
-
0
votes1
answer58
viewsQ: Autoplay videos when finished
I have the following code <div class="col-lg-12" style="padding:40px 10px 40px 10px;"> <div class="col-lg-1" style="padding-right:0;margin-top:20px;"> <i class="fa fa-chevron-left…
-
1
votes1
answer65
viewsQ: Watch duration of a Youtube video?
How is it possible to view the time of a video through the id of the video? With some research I found how to see the title but I could not find the duration. $content =…
-
-1
votes3
answers485
viewsQ: Select a div without it having a class or an id?
I’d like to do the following <div id="teste"> <div>Teste 1</div> <div>Teste 2</div> <---- Quero selecionar esta <div>Teste 3</div> </div> How could…
jqueryasked I_like_trains 1,430 -
1
votes0
answers32
viewsQ: How can I check the end of a youtube stream?
I know that using the youtube API I can check when a video ends. But what about a stream? The code is the same? This is an example of the code I use <iframe width="100%" style="height: 200px…
youtubeasked I_like_trains 1,430 -
0
votes2
answers50
viewsQ: How to redirect to a page if url does not contain a word?
I wish that if there was no string in the url, it would redirect to a page. This is what I tried $(document).ready(function () { if(!window.location.href.indexOf("www") > -1) { var link =…
jqueryasked I_like_trains 1,430 -
0
votes3
answers1395
viewsA: Mandatory completion
If you want to use only php, recommend so After the tag <select>, an error message should appear saying you are wrong. Use this code <?php if(isset($_POST['botao_submit']) &&…
-
0
votes1
answer2803
viewsQ: Change font after text to a div?
I have a div that has position: fixed, that is, accompanies the scroll. But I have a problem. Since the div has text with a color, if pass over a div darker, the text will not be visible. Is there…
cssasked I_like_trains 1,430 -
1
votes2
answers43
viewsQ: See if any of the array value exists in a string?
I am trying to make a language filter where it checks after each key pressed if there is any word not accepted. An example, this array ['insulto1','insulto2','insulto3']. How do I check if any of…
jqueryasked I_like_trains 1,430 -
0
votes1
answer246
viewsA: How to create a modal correctly to change data using W3
In ajax(), you can run php that comes out of the file. Let’s start at the beginning. If I understand correctly, each row of the table is referred to a id of the database, generated by while. (This…
-
3
votes3
answers2770
viewsA: Select from the line with the highest ID
One way to do it is this Select * from val_produtos order by id DESC LIMIT 0, 1 This way you will get the value with the highest id