Posts by Amadeu Antunes • 3,331 points
161 posts
-
2
votes1
answer1012
viewsQ: Create variables with a dynamically shaped array
Dynamically declare variables for($i = 0; $i < 10 ; $i++) { $arry[$i]= "var" .$i; echo $arry[$i] . "<br>"; $$arry[$i] = "ok"; //<-Aqui queria que a variavel $var'i' = "ok" } echo $var0…
phpasked Amadeu Antunes 3,331 -
0
votes3
answers391
viewsA: php doubts how to generate ten random password
Here is a solution function randomPassword() { $alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; $pass = array(); $alphaLength = strlen($alphabet) - 1; for ($i = 0; $i…
phpanswered Amadeu Antunes 3,331 -
0
votes1
answer69
viewsQ: How to put favicon in xml page?
How do I place fav icon on an xml page? As it exists in html I would like to do the same in an xml page
faviconasked Amadeu Antunes 3,331 -
0
votes1
answer75
viewsQ: Error in site map xml
My site-map is giving the following error XML Parsing Error: XML or text declaration not at start of entity Location: http://amadeuantunes.com/site-map.php Line Number 4, Column 1:<?xml…
-
0
votes1
answer115
viewsQ: I need to get the list of songs
I wanted to print the list of songs saved in an array listaMusica: System.out.println(p.listarMusicas()); This is the method for storing data: Musica v = new Musica(t, a, d, ano, g); p.addMusica(v);…
javaasked Amadeu Antunes 3,331 -
5
votes2
answers7112
viewsA: How to translate a website into PHP?
What I would do is: 1) created a folder named "lang" 2) placed 2 file Eng.php and (en.php or Eng.php) for example: Eng.php <?php $titulo = "My title"; ?> pt.php <?php $titulo = "O meu…
-
0
votes1
answer56
viewsQ: Notifications in the browser
I noticed that some websites for example facebook, when alquem writes in the chat appears a notification in the browser even if facebook has closed the same happens with news sites that when…
-
6
votes1
answer719
viewsQ: How to get only the domain of a URL?
The domain is not that of localhost. If the user types a link, for example, http://exemplo.com/pasta/pasta2/past/ficheiro.php, i intend that PHP returns only this part of the url exemplo.com…
-
0
votes1
answer283
viewsQ: How to set height in percentage using css
Is there any way to define height:80% 80% being the size of the div that it occupies on the CSS screen? class="wrapper" style="height: 80%;">
cssasked Amadeu Antunes 3,331 -
0
votes1
answer455
viewsQ: A white bar appears in the right margin causing the appearance of the horizontal scroll
I’m with a mistake and I’ve tried everything to fix the problem that causes the appearance of the horizontal scroll http://amadeuantunes.com/…
bootstrapasked Amadeu Antunes 3,331 -
2
votes1
answer65
viewsQ: How to shuffle this array within itself?
$img = array ( array("1.jpg","Logo","Tigre"), array("2.jpg","Logo","Cão"), array("3.jpg","Logo","Montanha"), array("4.jpg","banner","Design Grafico"), array("5.jpg","Logo","Dentista"),…
phpasked Amadeu Antunes 3,331 -
2
votes4
answers8575
viewsA: How to take system time and save in a variable?
#include <stdio.h> #include <time.h> int main () { time_t rawtime; struct tm * timeinfo; time ( &rawtime ); timeinfo = localtime (…
c++answered Amadeu Antunes 3,331 -
2
votes1
answer51
viewsQ: Is it possible to grab all the variables of a form at once to send to an email or do I need to declare one at a time?
It is possible to grab all the variables of a form at once to send to an email or I need to declare one at a time? <form action="welcome_get.php" method="get"> Name: <input type="text"…
phpasked Amadeu Antunes 3,331 -
3
votes3
answers1181
viewsQ: How to check if type="file" field has been filled
I have a form and have the following field <div class="form-group"> <label for="foto">Foto:</label> <input type="file" name="fileToUpload" id="fileToUpload" accept="image/*"…
phpasked Amadeu Antunes 3,331 -
1
votes1
answer954
viewsA: How to receive seconds value using HTML5 input time?
Try this way. <input type="time" class="form-control" step="1" name="hora" id="hora"> step define how far the seconds go for example if I put step="10" The seconds will run every 10.…
-
0
votes4
answers1272
viewsA: Run command Ctrl+V "paste" with mouse click inside an input
Okay, I used it like this on my website. <script type="text/javascript"> var copyTextareaBtn = document.querySelector('.textarea'); copyTextareaBtn.addEventListener('click', function(event) {…
-
1
votes3
answers506
viewsA: Can you start with underline?
Yes, in php these are the rules. Consult official PHP documentation about variables: "A valid variable name starts with a letter or underline" Examples: // Variaveis validas; $_variavel = 'valor';…
phpanswered Amadeu Antunes 3,331 -
0
votes1
answer241
viewsQ: How to make pictures change size without losing quality?
I am working on this site in bootstrap http://turismo.adopte-me.tk/ All I wanted was that depending on the format of screens the images did not lose quality I tested the following <style>…
bootstrapasked Amadeu Antunes 3,331 -
1
votes1
answer156
viewsA: Footer element do not descend using the bootstrap class when I open the menu in mobile mode
Corrected in this way html { position: relative; min-height: 100%; } body { /* Margin bottom by footer height */ margin-bottom: 120px; } .footer { position: absolute; bottom: 0; width: 100%; /* Set…
-
0
votes1
answer156
viewsQ: Footer element do not descend using the bootstrap class when I open the menu in mobile mode
In mobile mode is having problems when I open the menu as it collides with the buttons to pass images of Carousel and also with the footer CSS .footer { position: absolute; bottom: 0; width: 100%;…
-
3
votes1
answer561
viewsQ: Return to the previous page by setting a variable
Here’s what I’d like to do echo "<script>window.history.back()</script>"; this returns to the previous page what I intended was to return to the previous page but defining a variable we…
-
1
votes1
answer2125
viewsQ: How to allow only letters and numbers in a text box
I’m making a form and the first solution I saw was to create a keyboard with buttons with only letters numbers the erase button and the space button but now what I really wanted was a box that…
-
0
votes1
answer392
viewsA: any . htaccess file gives error 500 how to resolve?
I decided to reinstalled apache and the error disappeared.
htaccessanswered Amadeu Antunes 3,331 -
0
votes1
answer392
viewsQ: any . htaccess file gives error 500 how to resolve?
any file . htaccess gives error 500 how to solve? Whenever I put a file . htpaccess always gives error this is the code <IfModule mod_rewrite.c> RewriteEngine on # Redirect to domain with www.…
htaccessasked Amadeu Antunes 3,331 -
-3
votes1
answer140
viewsQ: How to redirect the old domain to the new one?
I would like to redirect the old domain to the new one, in the current code is occurring infinite loop. Follows my code: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule…
htaccessasked Amadeu Antunes 3,331 -
0
votes1
answer42
viewsQ: How to use the rel_canonical tag when two domains point to the same site?
I have two domains exemple.com exemple.tk they point to the same content including all their sub-pages how I use tag rel_canonical ?
htmlasked Amadeu Antunes 3,331 -
5
votes2
answers902
viewsQ: Domain . com has more relevance than . Tk to google?
I would like to know if a domain .com (www.example.com) is more relevant than the domain .tk(www.example.Tk). Or this has no importance for Google?
-
2
votes1
answer426
viewsQ: How to remove a variable from $_SERVER['REQUEST_URI']?
The variable $_SERVER['REQUEST_URI'] shows this search.php? page=6&typo_animal=Cat But what I wanted was to get search.php? typo_animal=Cat That would remove the page variable What I need is to…
phpasked Amadeu Antunes 3,331 -
0
votes2
answers331
viewsA: How to adjust bootstrap image height?
I resolved it this way @media (min-width: 1200px) { #imagem { height: 500px; } }
-
0
votes2
answers331
viewsQ: How to adjust bootstrap image height?
http://www.adota-me.tk/anuncio.php?id_anuncio=1455188994 In mobile mode the image height is too long as I can adjust that height ?…
-
-4
votes2
answers388
viewsQ: Sending email via php does not work
I’m using the same script I’ve used on other sites but it seems this site isn’t sending emails. If I send an email through virtual control panel min email is received in outlook in spam but gmail…
-
1
votes0
answers31
viewsQ: Problems with data type
My website is popping up like this http://www.adota-me.tk/anuncio.php?id_anuncio=1454792030 With some strange characters. I’ll tell you everything I put. In php this:…
-
1
votes2
answers1599
viewsQ: How to make all images the same size
I am using bootstrap and would like images regardless of which size were placed on the server to be the same size http://www.adota-me.tk/index.php…
-
0
votes1
answer159
viewsA: I’m getting this error Can’t connect to local Mysql server through socket '/var/lib/mysql/mysql.Sock' (2)
Okay what I did was increase the ram memory and changed the processor to a faster one and that worked. I had no further problems after these changes.
mysqlanswered Amadeu Antunes 3,331 -
1
votes1
answer159
viewsQ: I’m getting this error Can’t connect to local Mysql server through socket '/var/lib/mysql/mysql.Sock' (2)
Everything was working, but after a while I started constantly getting this mistake: Can’t connect to local Mysql server through socket '/var/lib/mysql/mysql.Sock' (2) The mysql server seems to be…
mysqlasked Amadeu Antunes 3,331 -
1
votes1
answer48
viewsQ: How to re-assign the ID colunda again?
I have a table for example | ID | NOME | | 2 | Ana | | 7 | João | | 15 | Vera | The ID column is ID int NOT NULL AUTO_INCREMENT, What I need to get? I intend for the column to stay | ID | NOME | | 1…
-
0
votes1
answer114
viewsQ: Why does gmail receive php email and outlook does not receive or send spam?
$to = "[email protected]"; $subject = "My subject"; $txt = "Hello world!"; $email ="[email protected]"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type:…
phpasked Amadeu Antunes 3,331 -
0
votes1
answer21773
viewsQ: What is the linux command to copy contents from one folder to another folder
I tried the following command cp -avr origem destino The problem is that the command creates a folder inside the destination and the contents inside. What I want is the contents directly in the…
linuxasked Amadeu Antunes 3,331 -
4
votes2
answers81
viewsQ: If I call a Javascript file, is that code visible in the browser (browser)?
I know that when I write code directly into HTML pages Javascript is shown but what if I call only the file, for example, like this <script src="script.js"></script> The code will be…
-
1
votes2
answers1109
viewsA: How to change the opacity of a part of the image?
To do what belongs can use javascript then I suggest the following examples javascript writing <!DOCTYPE html> <html> <body> <h1>My First JavaScript</h1> <button…
-
1
votes1
answer1195
viewsA: How to change the position of bootstrap elementals?
Okay, fixed the problem, let me explain: In bootstrap there are columns where they are marked with classes, the ones I used were col-Sm-3 col-Sm-6 col-Sm-3 before were col-Sm-3 col-Sm-7 col-Sm-2…
-
2
votes1
answer1195
viewsQ: How to change the position of bootstrap elementals?
I wanted to change the position of elements of a page formed in bootstrap As I present in the following images as I resize the page the buttons [EN][PT][ES] change positions and I believe it is…
-
1
votes3
answers5856
viewsA: Leave fixed elements on a static page
I don’t know if this helps much, but if you make a website using bootstrap this site gets formatted for devices like smartphones and tablets and automatically adjusts all page elements when the page…
-
2
votes1
answer26
viewsA: How to order processwire posts?
I solved the problem using the following code: $posts = $pages->find('template=blog-post, start='.$start .', limit=' . $limit . ',sort=-created');
-
1
votes1
answer26
viewsQ: How to order processwire posts?
To sort the posts by date I did the following: $posts = $pages->find('template=blog-post, start='.$start .', limit=' . $limit . ',sort=-date'); When modifying the code sort=-date and sort=date…
-
4
votes6
answers16518
viewsA: What does NULL really mean?
NULL, NIHIL, N/C - all this means null, unanswered, blank. The special value NULL represents that the variable has no value. NULL is the only possible value of the type NULL. Null is the ASCII…
-
8
votes2
answers1679
viewsA: Calculate Body Mass Index in C
#include <stdio.h> #include <conio.h> int main() { float height, weight, imc; printf("Hello World!\nWhat's your height?"); scanf("%f", &height); printf("What's your weight?");…
canswered Amadeu Antunes 3,331 -
4
votes1
answer1608
viewsQ: What is the equivalent function of Javascript window.location.href in PHP?
I intend to redirect the visitor to another page so I wanted the equivalent of window.location.href in php…
-
5
votes4
answers205
viewsQ: How do you round it up in PHP?
What is the function of php to round up? Example: 1.1 move on to 2…
-
1
votes2
answers920
viewsA: How to do an Xmlhttprequest to send values to the page itself?
I solved the problem as follows <script> function pagination(botao) { window.location.href = "?b=" + botao; } </script>…