Posts by Igor • 1,247 points
51 posts
-
0
votes1
answer1612
viewsQ: Security and login authentication in Ionic 3 using PHP-generated access token
I’m developing an application where the user can login by providing his email and password. After that, I make a request to my server PHP which checks in the database if the data exist and are…
-
2
votes1
answer457
views -
2
votes1
answer1252
viewsQ: Creating and configuring email in AWS (SES)
I have a PHP application and I need an email that will only be used to confirm entries on my system ([email protected]). I was taking a look at Amazon SES, however, I had some doubts: How to…
-
4
votes2
answers399
views -
6
votes1
answer2747
viewsQ: Raw Strength Algorithm for Sudoku Game Resolution in C
I have the following code written in C: #include <stdio.h> #include <stdlib.h> #include <time.h> // Variáveis globais int jogo_tabuleiro[9][9] = {0}; int func_quadrante(int…
-
-1
votes1
answer720
viewsQ: Sudoku game resolution giving infinite loop in C
I have the following code on C: #include <iostream> #include <stdio.h> #include <stdlib.h> #include <time.h> // Variáveis globais int jogo_tabuleiro[9][9] = {0}; int…
-
6
votes2
answers361
views -
0
votes1
answer814
viewsQ: Is there any way to merge multiple SELECTS into just one query?
I have a page where I will have to make several queries to the bank. At the moment, they are a total of three tables. They are: cadastro, publicacoes and estilo. Currently I do as follows: SELECT…
-
2
votes3
answers10597
viewsQ: Add element at the beginning of a key object/value
I have the following object: var exemploLista = { "Igor": "exemplo1.jpg", "Joao": "exemplo2.jpg" }; And I’m using this code to add an item to the object: exemploLista["Lucas"] = "exemplo3.jpg"; But…
-
2
votes2
answers322
viewsA: DIV only clickable if RADIO is marked
$(document).ready(function() { $(".radio").click(function() { if($("#radio1").is(":checked") && $("#radio2").is(":checked")) { …
-
0
votes2
answers764
viewsQ: How to query data from a table using INNER JOIN in a sub-query in PHP
I have the following SELECT to select data from a table (chat) in a chat system: SELECT * FROM (SELECT * FROM chat WHERE id_chat = '$chat_id' ORDER BY id DESC LIMIT 10) S WHERE id_chat = '$chat_id'…
-
3
votes1
answer199
viewsQ: Image loses effect of Camanjs when manipulating canvas
I have a canvas, in which I manipulate images drawn on it with the plugin Camanjs and works perfectly. However, if I manipulate the canvas manually (without the help of the plugin) the image loses…
-
3
votes1
answer70
viewsQ: Array items related to adding new item
I own a array that has 10 items, for example: var array_exemplo = ["item_1", "item_2", "item_3", "item_4", "item_5", "item_6", "item_7", "item_8", "item_9", "item_10"]; And, in my html, I have…
-
7
votes1
answer251
views -
4
votes1
answer1722
viewsQ: Select between two tables in PHP
I am currently using the following query to select all saved posts in the database: "SELECT * FROM postagens ORDER BY id DESC LIMIT 7", however, I want to select only the posts made by "friends".…
-
2
votes1
answer60
viewsQ: Select element through part of attribute contained in it
I have an element, for example: <div class="teste" data-info="isflaolatesteum"></div> And to select it, I could do it this way: $(".teste[data-info='isflaolatesteum']")... However, I…
-
3
votes1
answer265
views -
0
votes1
answer59
viewsQ: Select multiple to avoid 2 database queries
I have the following select (using PDO): $usuariosListados = $pdo->prepare("SELECT user_1, user_2 FROM usuarios WHERE user_1 = '".$_SESSION["usuario"]."' AND estatus = 2"); $usuariosListados…
-
2
votes1
answer2456
viewsQ: Update files after deploying to Heroku
I deployed my Node.js application to Heroku for the first time and it is working perfectly. However, I edited a file and I need to update it, how can I do this? Should I use git push heroku master…
-
1
votes4
answers646
viewsQ: Perform function by clicking except on specific item with jQuery
I have the following code: $(".teste").click(function() { return false; }); Inside that div .teste I have links with the class .link and I want, when clicking on the div, the return false, but that…
-
3
votes1
answer254
viewsQ: Block uploading images. gif renamed with . jpg or . png in PHP
I have an uploading system where the user can upload only images with extension . jpg or .png. It follows part of the code: $imagemNomeAntes = $_FILES["the_image"]["name"]; $imagemNomeAntesExt =…
-
1
votes1
answer86
viewsQ: Link being overwritten incorrectly when using preg_replace
I have a regular expression array that I use to replace url’s/hashtags in links using preg_replace: $regs = array('!(\s|^)((https?://|www\.)+[a-z0-9_./?=;&#-]+)!i', '/#(\w+)/'); $subs = array('…
-
2
votes1
answer48
viewsQ: str_replace() not working properly with generated arrays
Follows the code: $minu = range("a", "z"); $maiu = range("A", "Z"); $letras = array_merge($minu, $maiu); $minusculas = array_merge($minu, $maiu); By making a str_replace($Lminusculas, $Lmaiusculas,…
-
4
votes1
answer996
viewsQ: PHP hashtag system
I’m developing a hashtag system in PHP, and my question is this:: There’s how I make one SELECT publications based on the content? For example, the content saved in the database is: Hi, are you all…
-
14
votes1
answer2315
viewsQ: Real time with PHP
I am developing a system and soon I will have to start the real-time interaction part (for notifications and chat). I am using jQuery, PHP and MySQL so far and I intend to continue with these…
-
2
votes1
answer530
viewsQ: Detect if link is from the current or external domain with PHP
I’m currently using this expression with preg_replace to detect links in a content sent via POST: $conteudo = $_POST["conteudo"]; $conteudo =…
-
0
votes2
answers372
viewsA: Problem with PDO and mysql_query connection
You are not making a connection with PDO but with mysql. The message says the function mysql_connect() is deprecated, and will be removed from PHP. Ideally, use PDO or mysqli. A simple example of…
-
4
votes1
answer235
viewsQ: Image smaller than the original canvas upup when drawImage()
I am developing a system to filter images with canvas Html5, however, as I am at the beginning, I have already had some doubts and errors. At this "start" I want the canvas size to be equal to the…
-
1
votes0
answers48
viewsQ: Error while trying to insert gist embed (Github) via PHP
I am trying to insert an embed of a gist via PHP as follows: <?php echo "<script src='https://gist.github.com/schacon/4277.js'></script>"; ?> However, when parsing the console, the…
-
2
votes1
answer572
viewsQ: Using Foreign key with Cascade
On my system, when deleting a post, all comments that have the id_publicacao same as the publication are deleted from a table called comentarios_publicacao. And I do it simply by doing a check like:…
-
2
votes1
answer479
viewsQ: Table structure for PHP friendship systems
I am developing a system of friendships in my system and would like to know the best way to organize the table that will take care of such records amigos: I’ve thought of something: Tabela "amigos"…
-
2
votes1
answer56
viewsQ: Detect ":" and show suggestions with jQuery
I own a textarea and would like to know how to detect the character : and, from there, show suggestions listed in an array with all the possibilities of "auto complete" and go filtering the…
-
1
votes1
answer329
viewsQ: Database structure for comment system
On my system (PHP), it is allowed to make posts, which are saved in a table with their respective information: author, time, content, etc. Now, I’m thinking about adding comments to the post, but I…
-
3
votes2
answers301
viewsQ: Doubt regarding permanent links to posts
In my project, users can post, and I would like each post to have a permanent link so it can be accessed separately. What I’ve already thought: Create an archive php post. that would receive the id…
-
1
votes1
answer383
viewsQ: Load pages without duplicating content through AJAX
I have a navigation system by ajax + pushState on my website. If the user clicks on an internal link, a $.post and I check in PHP if $_SERVER["REQUEST_METHOD"] === "POST" then I load a page, for…
-
2
votes1
answer107
viewsQ: Create existing array array
I have the following line of code: $valores = implode(", ", array_values($dados)); and, by giving a var_dump(array($valores)); the following information is returned: array(1) { [0]=> string(26)…
-
5
votes1
answer761
viewsQ: Use PDO Prepared statements in function
I’ve been reading about prevention sql injections and saw to use Prepared statements can help with that. I have the following function in a crud class I developed: public function inserir($tabela,…
-
1
votes1
answer958
viewsQ: Error trying rowCount in PHP class
I’m trying to make a rowCount using a class I developed for the connection and some functions involving the bd. I have the following PHP class: class Banco { private $debug; private static $pdo;…
-
0
votes0
answers111
viewsQ: Doubt about $.getJSON on pages using PHP Templates
I know and already know how to use the method $.getJSON jQuery returning data that is returned with PHP by json_encode(). It turns out, in the project I’m developing, I use a Template (PHP) for…
-
1
votes1
answer116
viewsQ: Doubt about $.getJSON and history.pushState
I am studying about history.pushState and intend to develop a website as a way of study like this http://html5.gingerhost.com/ Regarding jQuery (function to load the new content) I understood…
html5-historyasked Igor 1,247 -
6
votes2
answers5494
viewsQ: Foreach inside of foreach
I need to run a foreach within another foreach in PHP. But it gives me the following error: Parse error: syntax error, Unexpected T_FOREACH referring to the line where the second foreach occurs.…
-
9
votes6
answers2106
viewsQ: Smooth gradient color transition automatically
Hello, I own a div with the following css: background: linear-gradient(to right, #3e42e4, #e53472); And I would like the colors to change through Javascript. Similar to the top of this site:…
-
1
votes1
answer98
viewsQ: Error trying to select with PHPOO
Well, I’m a beginner in PHPOO and I developed a class with functions to connect to the database (already successful) and another to select (where the error occurs). I will post the code and then…
-
2
votes1
answer1388
viewsQ: imagejpeg is not saving image
Follow the code, then the question. $localDiretorioFoto = "img/mensagens/"; $img = $_FILES["foto"]["tmp_name"]; $imgg = getimagesize($img); if($imgg["mime"] == "image/jpeg") { $nomeFoto =…
-
6
votes2
answers7305
viewsQ: How to compress images in PHP?
On my website, people can post messages and along with these messages an image (which is saved in a folder). I wonder if there is any class or any means using PHP to compress these images without…
-
4
votes0
answers71
viewsQ: Send image with ajax
I am trying to receive a PHP image sent through AJAX, but I was not successful. Follow the code: jQuery: $("#envmsg").submit(function() { $("#btn-enviarmsg").button("loading");…
-
4
votes1
answer926
viewsQ: Load data during page scrolling with jQuery
I need help to complete a code I’m developing. How can I do, so that when the user enters the page already appear the last 8 posts, and when the user gives the scroll, load the posts, within a loop,…
-
2
votes1
answer72
viewsQ: Use Regex on switch in jQuery
Guys, I have a question here and I don’t know if it’s possible to do what I want (I think so). The question is, I have a switch(link) and follow example of cases (example link): marry…
-
0
votes3
answers1176
views -
0
votes3
answers1176
views