Posts by Ricardo • 14,521 points
350 posts
-
1
votes1
answer585
viewsA: Copy the contents of a Json via PHP and send to the server
In this way: $string = file_get_contents("/home/pasta/test.json"); $arquivo = fopen('arquivo.json','w+'); if($arquivo){ if (!fwrite($arquivo, $sring)){ echo('Não foi possível atualizar o arquivo');…
-
6
votes1
answer161
viewsA: Because in PHP, some predefined constants are case-insensitive?
Because it is possible to store constants case-insensitive see in the documentation Link If set to TRUE, the Constant will be defined case-insensitive. The default behavior is case-sensitive; i.e.…
-
6
votes3
answers109
viewsA: In PHP, is NULL a constant or a keyword?
NULL is a guy according to the documentation Link and is also the only possible value of the type NULL (but that’s what’s in the documentation) So from the documentation it can be verified that NULL…
-
3
votes3
answers179
viewsA: Why ismysqli_ better thanmysql_?
Function MySQL are therefore impaired functions MySQLi end up being newer, safer, have new features (features) and are object-oriented. Aside from that MySQLi is an evolution of MySQL. There is…
-
3
votes2
answers99
viewsQ: Set roles for users stored in Database
How to structure in the database a structure of user roles (ordinary users, entrepreneur, site_amdin), each user will have different functionalities, different powers in the application that will…
-
-1
votes2
answers630
viewsA: Automatically add link protector to server links
Try it like this: $urlBase = 'http://anunciad.com.br?AuID=16958&Aurl='; $urlTotal = $urlBase . 'www.skydrive.com/arquivo1.mp3';
-
3
votes3
answers2845
viewsA: How to make ?
This character represents the character "space" (the same as if you press the space on the keyboard.) It is to be put by some of your javascripts. These sets of are harmless,…
-
7
votes2
answers16294
viewsA: Increase timeout of a page
You can increase the timeout as follows: set_time_limit(120);//coloque no inicio do arquivo You can leave without timeout (it will work indefinitely (if php is in safe mode this will not work))…
-
1
votes3
answers141
viewsA: Query problem - Accentuation
1st Alternative: Open the file .php on Notepad++ and go to menu button formatar and select the option: Codificação em UTF-8 (sem BOM), it is possible that the PHP source file is not utf-8. 2nd…
-
2
votes1
answer1895
viewsA: How to pass arguments in the Eclipse Ide console?
Right click on the project. Go to Debug As > Debug Configurations or Run As > Run Configurations. Click on the tab Arguments. Join your program Program Arguments Clicking Apply or Debug…
-
16
votes3
answers71632
viewsA: How to make a select in the bank not to bring repeated values?
Use DISTINCT will return without repeating: SELECT DISTINCT cor FROM Cores; another unorthodox solution would be to use GROUP BY: SELECT cor FROM Cores GROUP BY cor;…
-
0
votes1
answer42
viewsQ: Structuring in the bank the paths to the images and videos of my product?
How can I structure in the database the paths to the images and videos of my product? Below the SQL of product table creation: CREATE TABLE products ( id INT AUTO_INCREMENT PRIMARY KEY, name…
-
4
votes1
answer45
viewsA: Use 2 fonts in a sentence
Try it like this: .tipo1 { font-family: edosz; } .tipo2 { font-family: finger; } <span class="tipo1">Texto 1</span><span class="tipo2">Texto 2</span>…
-
1
votes3
answers6401
viewsA: Configure Phpmailer with Hotmail
It must be configured as follows: Link to download Link OBS: It is necessary to release door 587 /** *String que armazena o email de onde partirá os emails (remetente). *@var string */ const GUSER =…
-
3
votes5
answers16847
viewsA: Take parameters from the URL
This way it is possible to pick up the parameters sent via GET. var query = location.search.slice(1); var partes = query.split('&'); var data = {}; partes.forEach(function (parte) { var…
javascriptanswered Ricardo 14,521 -
0
votes6
answers17792
viewsA: Accentuation problem while recovering records in SQL Server
1st Alternative: Open the file .php on Notepad++ and go to menu button formatar and select the option: Codificação em UTF-8 (sem BOM), it is possible that the PHP source file is not utf-8. 2nd…
-
6
votes1
answer2994
viewsQ: Model "Product" table for multiple different product types
How to model the Table Product from a data bank? This table should store the following information: id, product name, quantity, price, status (if it is in stock, if it will be returned) and…
-
5
votes1
answer471
viewsA: Mysql now() does not display the correct time
This is a Time Zone problem: The time_zone variable can be adjusted directly in the Mysql client console. SET @@global.time_zone = '+3:00'; QUIT You need to log out and log back into your Mysql…
-
3
votes5
answers3255
views -
19
votes2
answers3101
viewsQ: What does "region above the fold" mean?
On the page of google developers there are several citations to this term: "Structure your HTML to first load only critical content, from region above the fold" What would this region above the fold…
-
3
votes1
answer157
viewsA: Why use @ in a variable?
Use @ on the front of expressions is used to suppress the display of errors on the screen (but does not eliminate the occurrence of errors). This solution will no longer display notices like the…
-
0
votes3
answers2504
viewsA: include php does not work
If you want to include conexao.php inside prioridade_dao.php would be this way: require_once '../../controller/conexao.php'; *If unable to include will give error and will be exposed error. The…
-
3
votes4
answers24420
viewsA: Turning HTML into PDF
I already make use of the Headless Browser Phantomjs to download COMPLETE WEB pages FAITHFULLY rendered to displayed in the common browser (it interprets JS and CSS) but with it it is also possible…
-
0
votes3
answers7829
viewsA: Put external font on website
In addition to the code of font-face you need to assign it to some selector in css like: Your @font-face @font-face{ font-family: "edosz"; src: url('edosz.ttf'); } Assigning the new font to a page…
-
2
votes1
answer74
viewsA: File Upload
Working with pure PHP (no framework). 1st there are two remarks: In PHP with default configuration the upload limit is 2Mb so test with smaller files. On some servers in order to save a file to a…
-
3
votes2
answers906
viewsA: How to send email through an HTML page?
1st OPTION: 1º I used Mandriljs which is a service that sends me 12 Thousand emails for free to you (this is not spam). works as a field medium to not need a server. Access link (you need to create…
-
1
votes1
answer49
viewsQ: Multiple identical Dwoo forms
I have a form built using the Template Engine Dwoo which has three variables (of data specific to the attributes "name" and "value"), this form will be inserted multiple times within another…
-
1
votes1
answer49
viewsA: Multiple identical Dwoo forms
To solve the problem of inserting multiple values into the same variable I change the value assignment location of the variable of the file responsible for the view to the previous assignment to the…
-
6
votes1
answer1912
viewsA: Compile multiple Java classes in cmd?
You can use these two commands: javac *.java or javac arquivo1.java arquivo2.java main.java *They must be in the same folder. Similar question in Soen Link…
-
1
votes1
answer258
viewsA: PHP - Full XML in var_dump
Print xml from a file_get_contents is possible with a simple echo $file = file_get_contents('http://example.com/rss'); echo $file; There are two more ways: print ($file); or using the asXML method:…
-
3
votes4
answers306
views -
2
votes2
answers169
viewsA: Static library
Option 1 and I think you should have tried to use the header: #include "libstatic.a" Point to the correct library location. 2nd Option found in this answer of Soen: cc -o yourprog yourprog.c…
-
0
votes3
answers215
viewsA: Leave current page highlighted in a page selection menu?
Using the instruction if supported by Dwoo Template I make a comparison between the name of each page and the address of the current page that is inside a variable passed by the data array (data…
-
0
votes3
answers215
viewsQ: Leave current page highlighted in a page selection menu?
I have a page selection menu whose final appearance (the current page highlighted with a different color) should be generated dynamically because I want to reuse the same menu for numerous pages, as…
-
1
votes3
answers751
viewsA: Problems with uploading images in PHP
Try so, this way you will store the image in BD: $nomeFinal = time().'.jpg'; //nome final que será trocado com o temporario //move e renomeia o arquivo (se conseguir mover é porque o arquivo enviado…
-
2
votes3
answers406
viewsA: Parse error: syntax error, Unexpected {
It should stay this way by closing the key to the else and the parenthesis of if: <?php session_start(); if(isset($_SESSION['user'])){ echo…
-
1
votes2
answers469
viewsA: Inject results and pagination into an html
Here is an example of paging that involves a database search: <?php //conexão com o banco de dados mysql_connect("localhost","root",""); mysql_select_db("banco_teste" ); //verifica a página atual…
-
4
votes2
answers9331
viewsA: Change numerical field accuracy SQL SERVER
Try this will change the column type: ALTER TABLE tabela ALTER COLUMN coluna NUMERIC(5,2); For your specific problem I believe that the error is not the SQL command but the presence of some value…
sql-serveranswered Ricardo 14,521 -
14
votes3
answers14534
viewsA: What is the INDEX index in Mysql for?
To create a índice (Indexes are used to find records with a specific value of a column quickly. Without an index Mysql has to start with the first record and then read through the entire table until…
-
12
votes2
answers8037
views -
3
votes1
answer50
views -
1
votes2
answers67
viewsA: Search only a random part within a select mysql code
If the type of column is: CHAR or VARCHAR is sure that the LIKE will work perfectly: SELECT * FROM `tabela` WHERE campo LIKE “%n3fbrqv345d4231qepklnt3i73%” Also try using the string function INSTR:…
-
4
votes1
answer254
viewsA: Block uploading images. gif renamed with . jpg or . png in PHP
Test as follows (present in PHP documentation) <?php if (exif_imagetype('image.gif') != IMAGETYPE_GIF) { echo 'Imagem não é um gif'; } ?> Link to documentation: Documentation…
-
4
votes4
answers140
viewsA: How to add class to the first <img src=""> of a set
It can be done this way: $("a img").first().addClass('classe');
-
0
votes4
answers2949
viewsA: Fix div at the bottom of the page
Use a combination of position:absolute in the element you want to fix below. footer { padding-top: 10px; padding-bottom: 10px; background-color: #BBBDBF; position: absolute; bottom: 0;…
-
0
votes3
answers436
viewsA: Problems Configuring Gradient in CSS
Try this and you will see a gradient similar to the one you want: <div class="gra"></div> .gra{ background-image: linear-gradient(to right, #fff, #0000FF); height: 100px; border: 1px…
-
0
votes1
answer48
viewsA: Error 500 when adding redirects to errors 425 to 499
As stated by the user @qmechanik these codes are invalid or not yet implemented as you can see on the IANA(Internet Assigned Numbers Authority): 425 Unassigned 426 Upgrade Required [RFC7231, Section…
-
1
votes1
answer184
viewsA: How to maintain banner of website partnerships?
To keep the banner data of the partners' sites I created two tables in the database one to keep the partner type (I think optional) and one to save the banner data: INSERT INTO partner_type(valor,…
-
2
votes1
answer3441
views -
2
votes3
answers878
viewsA: image and hr side-by-side
An edit to @Guilhermenascimento’s reply would be to do as follows if you cannot place a display:block .container img { float:left; padding: 0; margin: 0; } .container hr { position:relative;…