Posts by Alexandre Lopes • 2,769 points
97 posts
-
0
votes1
answer52
viewsQ: Function to simplify records in Mysql with PDO - You are saving all identical values
I am trying to create a function to simplify insertion of records in Mysql using PDO. The function is working but recording identical values. Follow the PHP script: <?php function…
-
-3
votes1
answer83
viewsQ: How to filter and sort rewritten JSON elements with PHP?
The script below fetches the JSON file and restructures it into a new template. <?php $json_strcont = file_get_contents("http://app.tce.ma.gov.br:8889/remessas?enteId=2102309"); //Puxa todas as…
-
0
votes1
answer72
viewsQ: How to rewrite / restructure JSON from external URL?
That is a question that I have long considered asking here at Stackoverflow. I have looked all over the internet for a solution, but I did not succeed. I did not find any subject here on Sopt. The…
-
-2
votes1
answer168
viewsQ: How to customize PHP errors?
I’m having the following doubt, imagine I’m making the requisition of a file JSON external via a script PHP <?php $json_file = file_get_contents("http://exemplo.com/arquivojson"); ?> And if…
-
0
votes1
answer114
viewsQ: Correct way to get JSON "Sub Array’s" values in PHP
I made the following code: <?php //dados de um arquivo JSON $json_str = '[ { "documentoId" : 1057615, "nome" : "1542980818602.pdf", "assunto" : "AQUI FICA O ASSUNTO DO DOCUMENTO", "dataEnvio" :…
-
-1
votes3
answers340
viewsQ: Change CSS property when doing :Hover over another menu link
I need to make sure that by hovering the mouse over the menu links, it is removed or changed to transparent the background of the link that is active (from the page that I am on). Demonstration:…
-
0
votes2
answers95
viewsQ: Page does not recognize href=" "as if there was no href=" ", nothing happens - PHP
I’m finishing up a project, but I had a little problem. On the page there is a "button" where a document is downloaded. But when you hover over, or even click, nothing happens, it’s like any…
-
-1
votes1
answer799
viewsQ: PHP - How to send background request ( HTTP SMS API )
I am making a form which as soon as it is sent, it should send an SMS thanking for the contact to the number in which it was informed in the form. I have the following form: <form…
-
0
votes2
answers146
viewsQ: Is it possible to change the background color of an element for printing?
Is it possible to change the background of an element in the print style sheet? I have the following code: <td valign="top" bgcolor="#dddddd" class="cinza" nowrap="">Seu Nome<br> <div…
-
8
votes2
answers5548
viewsQ: How to get current directory name in PHP
I Googled and here on Sopt, but I did not find any site, or question here that would answer this question. Example: I’m on the page index.php who is in /5/index.php, then only the 5. How to print…
phpasked Alexandre Lopes 2,769 -
-3
votes1
answer96
viewsQ: Make PHP print names in certain classes
The following Javascript code has the function of print a text in the elements with the class exibir: $(document).ready(function(){ $(".exibir").text("Olá Mundo!"); }); <script…
phpasked Alexandre Lopes 2,769 -
-1
votes1
answer39
viewsQ: Display certain image for derminated numbers
I got the following <input> and <img> on the page. <input class="form-control" id="cordenadasaqui" value="47644.63956 74592.843" readonly> <img id="imagemaqui"…
phpasked Alexandre Lopes 2,769 -
0
votes2
answers5524
viewsQ: Boleto Bancário - Convert digitable line into barcode?
It is possible to convert the digitized line of a bank note into a barcode? I searched on this subject and found nothing that would help me to remove this doubt. Example I have the following line:…
phpasked Alexandre Lopes 2,769 -
-1
votes1
answer518
viewsQ: PHP - Create . TXT file with Visitors' IP log
I have the following link: <a target='_blank' class='btn-primary' href='exemplo/1/'> Clique Aqui </a> I need every time the page containing this link is accessed by a different visitor (…
phpasked Alexandre Lopes 2,769 -
1
votes5
answers375
viewsQ: Make <a> change href=" button on each new visitor ( IP ) on a given page
I have a little doubt in a project that I’m developing. The following happens, I have 2 buttons on the page, like these ( identical in different positions ): Top of the page: <a target="_blank"…
phpasked Alexandre Lopes 2,769 -
1
votes1
answer2014
viewsQ: How to block user from returning to previous browser page
Is there any method that makes a user unable to return to the previous page? I happen to have a contact form in which the person must complete and ready. It is not possible to return and fill again.…
javascriptasked Alexandre Lopes 2,769 -
3
votes1
answer29
viewsQ: How to make element appear only for Mozilla Firefox users
I have a site that is not half misaligned on Mozilla Firefox, I tested in some browsers, including the Internet Explorer, who by the way displayed the page perfectly. Only the Mozilla Firefox You…
-
4
votes3
answers221
viewsQ: Redirect page if resolution less than 767px
Searching on the internet, I found this question here at Sopt: Redirect to mobile site In the question was placed a code that redirects a page if accessed by a mobile device (mobile). I am using…
javascriptasked Alexandre Lopes 2,769 -
0
votes5
answers200
viewsQ: Error when redirecting after sending form
My code: <?php header('Content-Type: text/html; charset=utf-8'); $email=$_POST[email]; $nome=$_POST[nome]; $cor=$_POST[cor]; $nascimento=$_POST[nascimento]; $cep=$_POST[cep];…
phpasked Alexandre Lopes 2,769 -
6
votes3
answers249
viewsQ: Change data value=" of tooltips if displayed in resolution less than 767px?
I’m implementing a few tooltips on a contact form I am developing. It turns out that when it is loaded in lower resolution (below 767px), it is cut tooltips. This is due to the fact of tooltips have…
-
1
votes2
answers149
viewsQ: PHP - How to make a GET pull a include?
If I access a page like for example http://localhost/? color=blue Using the following GET: <?php echo ($_GET["cor"]) ; ?> The name will be printed Blue. It is possible to make instead of…
phpasked Alexandre Lopes 2,769 -
-4
votes2
answers924
viewsQ: How to take text from another page and insert it into an input?
I have a small doubt in a project I’m developing. The following happens: I have this input on a page (index php.): <input id="exibe" value="Aqui vai ficar o texto **que foi** copiado"> On the…
phpasked Alexandre Lopes 2,769 -
5
votes1
answer424
viewsQ: Make <a> change href=" button with each new access on a given page
I have a little doubt in a project that I’m developing. Here’s the thing, I have two buttons on the page, like these ( identical at different positions ): Top of the page: <a target="_blank"…
phpasked Alexandre Lopes 2,769 -
5
votes3
answers259
viewsQ: Javascript - Make <article> appear by clicking on a <li>
I have a little doubt in my project that I am developing. I need to make that determined <article> appears when a certain <li>. Example <li>'s <li id="menu-CARD">USAR…
-
1
votes2
answers1648
viewsQ: Javascript - How to input back to normal state after validation
I am working on a form which if the person does not fill in the fields, the <input> gets a red border, and at the bottom appears the name "Required field". Everything is working fine, but I…
javascriptasked Alexandre Lopes 2,769 -
1
votes3
answers163
viewsQ: PHP - How to make sure that if a POST is not entered, it does not appear "Notice: Undefined index"
It is possible to make sure that if I do not enter data in a form with method="get", when you go to action="/minha-url.php", if you have not entered data in the previous form, simply nothing will be…
phpasked Alexandre Lopes 2,769 -
3
votes2
answers933
viewsQ: Javascript - How to validate form fields
I’m creating a form that I need to validate: E-mail, CPF, Birth Date, Contact Phone, Optional Phone. Someone knows how to do this with that "mask", that when the person type the date for example,…
javascriptasked Alexandre Lopes 2,769 -
4
votes1
answer698
viewsQ: Javascript - Copy content from a <span> to clipboard by clicking a <button>
I am creating a CPF generator, which when the person generates, appears an option "Copy", but I would like to know how to implement the functionality of copying the content that is presented.…
javascriptasked Alexandre Lopes 2,769 -
-3
votes1
answer1360
viewsQ: Change display property of a <div> by clicking on an <input>
I’m working on a contact form that when the person clicks on <input> there appears a <div> by the side, mentioning some things the person should do. Ex: Enter your email here. How to…
javascriptasked Alexandre Lopes 2,769 -
1
votes2
answers59
viewsQ: Javascript - How to add to all href="" of a div a domain "http://site.com"
I’m with a system that seeks product suggestions via ajax. He pulls the information, but this information comes from an external site, and he has the local URL. href="/produto/123, need to get it…
javascriptasked Alexandre Lopes 2,769 -
1
votes1
answer287
viewsQ: Countdown that renews at midnight using pure javascript
How to show the hours and minutes remaining to 00:00 hours (midnight) ? Example: I have a sales website on which I want to put a countdown that says the time remaining for midnight, which at…
javascriptasked Alexandre Lopes 2,769 -
0
votes1
answer1768
viewsQ: How do I get a form to send email to 2 recipients?
I created a form where the user fills in some information and is sent an email to me with this information. Only at the moment it is only sending to 1 email. Below follows the code: <?php…
phpasked Alexandre Lopes 2,769 -
4
votes2
answers2072
viewsQ: How to do that when submitting a form within an iframe, the page that has iframe is redirected?
I’m creating a page that works like this: The person accesses a registration page, and within that page there is a iframe with the registration form. When a person clicks inside the iframe in…
-
1
votes0
answers62
viewsQ: How to Insert a Slider to My Website
I am developing a website and would like to add a simple but elegant slider. Is there any plugin, preferably jQuery, that allows me to create a slider like the of this website?…
-
2
votes1
answer1190
viewsQ: How do I make a <div> close when it’s clicked off?
It is possible to make it if the person clicks off a div which contains flags it automatically closes, but if it clicks inside the div of the flags nothing happens? NOTE: Only if you click outside…
jqueryasked Alexandre Lopes 2,769 -
4
votes4
answers9657
viewsQ: How to open a <div> by clicking on a <a> link?
I’m creating an element for a personal website, and I’d like that element "<div>" is open/closed when clicked on a button. Is a <div> containing some country flags to change language. I…
jqueryasked Alexandre Lopes 2,769 -
1
votes3
answers1694
viewsQ: How to do when a button is clicked is created an element on the page?
I need that when a person clicks on a given button, an element is created on the page. I’ll explain what I want to do with it. I’m creating a button, and when it’s clicked, a modal-box (a kind of…
-
0
votes2
answers197
viewsQ: How to set an element via jQuery/Javascript?
I’m doing an integration with a social plugin and I’m having a problem. My code: linkedin : function(self){ var sett = self.options.buttons.linkedin; $(self.element).find('.buttons').append('<div…
-
0
votes0
answers49
viewsQ: How do I insert a social counter into my website?
I would like to insert a social counter on my website, however I don’t want anything from outside services (use iframes for example), such as Shareholic. I want something more internal, via API or…
-
3
votes4
answers958
viewsQ: How to display information (domain name) using PHP?
How I can display information on my website using PHP? I am creating a personal website, and I want to make versions of this site in other languages. What happens is that I need to set the domain of…
phpasked Alexandre Lopes 2,769 -
2
votes2
answers225
viewsQ: How do I get the files pulled from the root of the site?
I’m creating a website... So far so good. I created friendly Urls. Before my URL was something like: localhost/site/produto.php And now it’s: localhost/site/produtos/produto/planos I wanted a code…
phpasked Alexandre Lopes 2,769 -
12
votes1
answer159
viewsQ: What can be done to improve the performance of a very large CSS (384KB)
My site has a style sheet, already minified, with a total size of 384KB. If possible, what can I do to improve performance? I thought of compressing with GZIP, which would leave the sheet with 59KB,…
cssasked Alexandre Lopes 2,769 -
4
votes3
answers801
viewsQ: How to change a <a> link according to a <select>?
I’m creating a price list for my website, and I need when the person changes the payment cycle, the link be changed <a> (HIRE) to go to the cart. Example: If the person selects the cycle…
jqueryasked Alexandre Lopes 2,769 -
3
votes2
answers3680
viewsQ: How to do the . jQuery load only the content inside the <main>?
How could I make for that function .load instead of loading the contents of <body> only load content inside <main> ? My jQuery: // Checa se a página foi carregada para evitar aplicar os…
-
5
votes3
answers2101
viewsQ: How to put transition in a dropdown of a menu?
I currently use the following code: $("#menu").find('li').hover(function () { $(this).children('ul').clearQueue().slideDown(600); $(this).children('a').children('ul').clearQueue().show(0); },…
jqueryasked Alexandre Lopes 2,769 -
0
votes4
answers723
viewsA: How to create a link that when clicked is added a CSS property in a div?
Reply edited by @Silasribeiro I don’t know much about jQuery, but I just followed the logic. I just changed some things, like margin for padding, I switched the ID #a to the Classe .zopim, and…
jqueryanswered Alexandre Lopes 2,769 -
2
votes4
answers723
viewsQ: How to create a link that when clicked is added a CSS property in a div?
I have a div on my site with the class .zopim, how can I do for when the person clicks on the link div classy .zopim receive a margin-bottom:20px ? Like this: When the person clicks: <a…
jqueryasked Alexandre Lopes 2,769 -
1
votes2
answers581
viewsQ: How to create a link that when clicked changes the value of href=""?
I am creating a button to open the chat on one of my sites. I am currently using Zopim. To open the chat, the link is used: <a href="javascript:void($zopim.livechat.window.show())">ABRIR…
jqueryasked Alexandre Lopes 2,769 -
3
votes1
answer184
viewsQ: Doubts about SEO
Lately I have been faced with a lot of doubts, and I felt like coming here to publish some of them... Structure of Urls What is the correct way to Urls? Suppose I register domains.…
seoasked Alexandre Lopes 2,769 -
5
votes2
answers938
viewsQ: I have a multi-language site, in the matter of SEO which is better: Using Subdomains or Directories?
I am creating a site with several languages (Portuguese, Spanish, English). On the question of SEO what is the most correct way to use? Subdomains ( pt.meusite.com ) or Directories ( meusite.com/pt…
seoasked Alexandre Lopes 2,769