Posts by MagicHat • 12,262 points
358 posts
-
9
votes2
answers12115
viewsA: Create folder in php
You can try this example: <?php mkdir(__DIR__.'/arquivos/nome_da_pasta/', 0777, true); ?> or mkdir(dirname(__FILE__).'/arquivos/nome_da_pasta/', 0777, true); Note that the 777 permission…
-
4
votes1
answer49
viewsA: How to find content without a specific tag
Example : Any formatting that div father have the daughters will inherit. <div class='texto'> <p>Essa imagem é muito bonita!</p> <img src='imagens.png'/> Foi tirada em…
-
1
votes1
answer2645
viewsA: Doubt fixed navbar at the top with Bootstrap
I would do so : body{ background-color: whitesmoke !important; padding: 0px !important; } #nav{ background-color: whitesmoke !important; box-shadow: black 0 0 5px; opacity: 0.3; }…
-
1
votes3
answers779
viewsA: Assigning an image(s) value to the Javascript input
I didn’t test it, see if it helps... function NovaPublicacao() { var elem = document.getElementById("imagefiles"); var images = []; for (var i = 0; i < elem.files.length; ++ i) {…
-
0
votes1
answer645
views -
1
votes1
answer135
viewsA: Upload photos with Javascript/Ajax preview
You can see this code as an example: <legend class="leg_img">Insira imagens</legend> <fieldset id="upload_img" class="nf_class upload_img"> <input type="file" id="files"…
-
0
votes1
answer102
viewsA: Select Query with AJAX and PHP
Example : <!DOCTYPE html> <html> <head> <script> function showHint(str) { if (str.length == 0) { document.getElementById("txtHint").innerHTML = ""; return; } else { var…
-
0
votes1
answer103
viewsA: Insert an ID into SQL+PHP
An example code for this action. <?php //Define as variáveis do banco $servername = "localhost"; $username = "username"; $password = "password"; // Cria a conexão $conn = new mysqli($servername,…
-
0
votes2
answers796
viewsA: How do I view data from a specific line in a database without knowing which line it is?
In case, you have to pass the variable $id, in his query,where is, id = 1, pass the variable, id = $id .For example : $cidade in your SELECT, is a variable value, coming from somewhere, that is not…
-
1
votes2
answers827
viewsA: How to make a form appear on the screen when clicking a link?
You have this option... See if it helps. .lightbox { /** Esconde a classe lightbox */ display: none; /** Estilo basico para a classe */ } .lightbox:target { /** Aplica essa regras quando target…
-
2
votes3
answers12026
viewsA: Vertical text with css (90º)
Another suggestion. .textovertical{ width:1px; word-wrap: break-word; font-family: monospace; white-space: pre-wrap; } <p class="textovertical"> Olá esse é um texto vertical ! </p>…
-
5
votes1
answer1629
viewsA: Change the header background of only one Ionic page
You can define a specific style sheet for your page with the rules you want. By placing the reference to the file in the head from the page you want to apply the rule. You can do it with javascript,…
-
0
votes1
answer100
viewsA: How to handle elements of an array individually?
Well if I understand your doubt add this to the code and it should work: echo "<p> Fatura $fatura Emitida dia $emissao Vencimento $vcto=><a href='$loc'…
-
1
votes1
answer333
viewsA: Regular expression to identify text box in HTML form
You can use the following expression: <\s* input [^>]+ >/xg < Coincides with "<" literally \S will match any blank character [ r n t f]. * between zero and unlimited times, as many…
-
1
votes1
answer280
viewsA: Word restriction
Good though you can do in HTML as well. <form action=""> Palavra : <input type="text" name="palavra" pattern="^((?!PQP).)*$"> <input type="submit"> </form> Thus the string…
-
0
votes3
answers355
viewsA: Adjustable div with css
You can do it like this, see if it helps. Anything comments that agent adjusts. <body> <div id="geral"> <div id="d1"></div> <div id="d2"></div> <div…
-
4
votes2
answers2828
views -
1
votes1
answer1370
viewsQ: Limit the number of characters in a select HTML/CSS/JS field
I know through the attribute maxlengthit is possible to limit the number of characters of a input. The doubt: This property applies to select, if not what its equivalent would be, or how to achieve…
-
2
votes1
answer38
viewsQ: Dialog inside php/ajax/js form
Well at first glance, the title already shows the error, but this is the process I need but I have no idea how to execute it. Given a simple form for example: <form method="post"…
-
1
votes2
answers83
viewsA: @media screen not working properly
In case you can use (max-width) that is to say maximum width, and when it reaches that width it will make the Pape of it.
-
2
votes2
answers2862
viewsQ: Is it possible to create a title for the "select" tag without it being part of the options?
I have a question about the "select" tag, if it is possible that it has a visible title without being part of the options?
-
1
votes1
answer55
viewsQ: Move links to list menu when mediascreen size is changed
I’m having a hard time putting some links inside another link. For example: #menu_header_right{ float:right; } .dropdown{ width:80px; position: relative; display: inline-block;} .dropdown-content {…
-
3
votes1
answer2107
viewsA: take input value and redirect page after Submit
You can take the amount by id and uses location.href <form> <input type="text" id="valor_busca"/> <input type="submit" value="Pesquisar" onclick="redireciona()"/> </form>…
-
1
votes1
answer33
viewsQ: Local and global variable difficulty - PHP
I’m having trouble understanding how to use the value of a local variable in another statement: I am using this concept in the following code : <?php if(isset($_GET["email_cad"])){ //quero usar a…
-
1
votes1
answer1631
views -
0
votes3
answers881
viewsA: Receive variable in php and call Ajax function by passing this variable
I think now I understand what you are wanting. see if this is it, I did a simple test and it worked here. <script> function loadDoc() { var xhttp = new XMLHttpRequest();…
-
0
votes1
answer154
viewsQ: Add specific keys obtained in SQL query - PHP
I have an sql query that returns all the fields of a table : $registro = mysqli_query($con, "SELECT * FROM agenda ORDER BY procedimento LIMIT $limit, $nroLotes"); My doubt is, if it is possible,…
-
1
votes2
answers567
viewsA: Problems with dropdown menu
See if this is what you need. It would be nice if you put your html in your question. You just put the links to your style sheet. <!DOCTYPE html> <html> <head> <style> ul {…
-
0
votes1
answer611
viewsA: What is the difference between max-width and max-device-width?
max-width is the width of the target view area, for example the browser. max-device-width is the width of the entire rendering area of the device, i.e., the actual device screen. Copied from SO-EN…
-
2
votes2
answers1816
viewsA: Difference between dates in javascript months
See if that’s it... The accepted format is with bars : yyyy/mm/dd or dd/mm/yyyy or commas yyyy,mm,dd <input type="date" id="dt1">Data 1</br> <input type="date" id="dt2">Data…
-
1
votes2
answers1283
viewsA: How to replace the text of an element with another text?
It may be so <p id="elemento">isto é um</p> <script> var elementoTexto = document.getElementById("elemento").innerHTML document.getElementById("elemento").innerHTML = elementoTexto…
-
1
votes1
answer394
viewsA: Divs of window size
What happens is this: You are defining the div mapa, with height:100%, but you have more 100pxin div um, then your content will have 100% + 100px height. And when the content height exceeds the…
-
1
votes3
answers1216
viewsA: View image in Javascript
You can do it like this. <script type="text/javascript"> var dispositivo = navigator.userAgent.toLowerCase(); console.log(dispositivo); if(dispositivo.search(/android/) > -1) { var x =…
javascriptanswered MagicHat 12,262 -
3
votes2
answers9850
viewsA: How to input accepting only letters?
I will make an example in javascriptpure. Using regular expressions. <form name="form_name" action="recebe_form.php" method="post"> Name: <input id="input_nome" type="text" name="fname">…
-
1
votes1
answer66
viewsA: Still images on the side with scrolling content only
Use the property position:fixed #agenciados {position:fixed;) See if that’s it, anything comments that we set, if that’s it, could validate the answer. I hope I’ve helped,…
-
0
votes3
answers572
viewsA: I want to change the color of the button according to the value of the variable
Change !isset for isset. If $linha was initialized echo "sucess"!
-
1
votes1
answer64
viewsA: Autosize divs with div overflow Hide between them
Well there are some ways to do that, I usually use width: calc, but it could be with flex-Grow, it will depend on what you want as a final result. *{border: 1px solid #000011;} #tabs{display:flex;}…
-
1
votes2
answers2141
viewsA: Taking keys from an array
You can use the key function(): <?php $array = array( "one" => 1, "two" => 2, "three" => 3, "four" => 4 ); while($element = current($array)) { echo key($array)."\n"; next($array); }…
-
0
votes1
answer643
viewsA: Problems with SECTION and ASIDE (HTML5)
I made a few minor changes, the main one defining a width for the div interface. I advise you to review this structure, and develop a basic skeleton, only with the basic forms and then put the…
-
0
votes1
answer69
viewsA: links are leaving space
You can set the size of li with 80px and the Nav with width:auto. * {box-sizing:border-box;} nav#menu { position : fixed; top : 0; width : auto; left : 0; z-index : 10; } nav#menu ul { padding : 0;…
-
4
votes2
answers19261
viewsA: calculating days between php dates
You can use this function: <?php $date1=date_create("2016-07-10"); $date2=date_create("2017-08-13"); $diff=date_diff($date1,$date2); echo $diff->format("%a"); ?> //Saída: 399…
-
0
votes1
answer139
viewsA: Save combobox value when uploading files?
@Allan I do this way, then you adapt to your code. php form. <form action="insere.php" method="POST" enctype="multipart/form-data"> <select name="cat"> <?php //conexão include…
-
3
votes4
answers1313
viewsA: How to organize alphabetically a select obtained through a JSON?
@Marcelo de Andrade is a little late, but he can do so too. This way, it will reorganize the keys and eventually if you write from the BD, it will record the Keys numbers for the respective states.…
-
25
votes2
answers4666
viewsQ: foo and bar - Does it have any special meaning?
In most code examples in various languages, I see these two nominations for variables - foo and bar. Is there any special meaning to them?
terminologyasked MagicHat 12,262 -
1
votes1
answer2976
viewsA: Php does not connect to database (Mysql)
Boss does not usemysql_ no, this function is obsolete... Try this: it has several forms of connection, I use so... <?php $servidor = 'localhost'; $usuario = 'root'; $senha = ''; $banco = 'test';…
-
4
votes2
answers1683
viewsA: How to sort this php array?
I’m a little late, but you can do it like this: Using array_multisort <?php //array $res = array(); $res[] = array("16/08/2013", "13:32", "ROBERTO"); $res[] = array("30/01/2011", "13:16",…
-
0
votes3
answers1376
viewsA: Retrieve data in Mysql DB using AJAX/PHP to create a badge containing DB item count
Boss I did so worked out here... Then fits your code. I may be wrong, but in your code "data" is only declared for output and not to receive from php (I don’t know if this is it, is what I "think").…
-
3
votes1
answer3629
viewsA: How to set charset=utf-8 in Mysql?
I got added on my.ini itself [client] default-character-set=utf8 [mysql] default-character-set=utf8 [mysqld] collation-server = utf8_unicode_ci init-connect='SET NAMES utf8' character-set-server =…
-
3
votes1
answer3629
viewsQ: How to set charset=utf-8 in Mysql?
I’m trying to set up the charset=utf-8 in MYSQL, but not found in my.ini file. In which file configure ?
-
0
votes0
answers49
viewsQ: Select the UTF-8 Aptana Studio 3 encoding?
I’m not finding the place to set up the encoding in Aptana, if anyone can help ?