Posts by Lauro Moraes • 3,871 points
143 posts
-
2
votes5
answers227
viewsA: What are strings started with @inside PHP comments?
The strings started with @ in comments on PHP are used to standardize documentation. The standardization proposed by the group PHP-FIG for documentation currently on DRAFT which means "a state of…
phpanswered Lauro Moraes 3,871 -
2
votes1
answer75
viewsA: doubt with include php
You can use __DIR__ of the counting predefined **example*: function Query($conexao, $query) { // Includes include __DIR__ . "../Dados.php"; } __DIR__ will point from the directory where the function…
phpanswered Lauro Moraes 3,871 -
1
votes2
answers317
viewsQ: Personalize PHP session cookie
I’m using a Handler customized to save sessions on MongoDB and a custom class to create cookies attribute-ridden SameSite using the function header(), although this specification is not widely…
-
0
votes2
answers770
viewsA: Jquery function click on dynamic PHP links
If the element was created dynamically use on of jQuery in the BODY element instead of direct click and of course insert this id in the element containing the clickable class ex: <div>…
-
0
votes1
answer765
viewsA: traverse array and insert break line jquery
Well the example below is well commented but I highlight the fact of storing the indexes adding them to the beginning because in this example these indexes "stored" are returned by the method pop…
-
2
votes3
answers249
viewsA: Change data value=" of tooltips if displayed in resolution less than 767px?
You can use an auto-executable function that checks all elements with the class js=tooltip and to perform the main function in the event resize window. Regardless of the user opening on a desktop or…
-
0
votes1
answer50
viewsA: problems with php, json, javascript and mysql
If it shows the return on the console you may not be returning an object... try to see what kind of element is returning. console.log(typeof result); If you’re the type string and is in the format…
-
0
votes1
answer255
viewsA: Disable page while loading Progress bar
Good friend the code of the "bar" is not very useful since this "minificado" as to Pace.js the library has option to monitor the loading of certain elements as shown in documentation. Now if what…
phpanswered Lauro Moraes 3,871 -
5
votes5
answers200
viewsA: Error when redirecting after sending form
The page php that you set as an example this getting via POST to capture the bad "attributes" by the example you posted from the form seems to be sending via GET. Change the method from your form to…
phpanswered Lauro Moraes 3,871 -
18
votes3
answers421
viewsQ: To observe an error in the iframe element with "sandbox" attribute
I have in my document one iframe with the attribute sandbox. With javasript i do reading a file Markdown and parse using the library showdonwjs and add that result to the attribute srcdoc of iframe…
-
0
votes0
answers517
viewsQ: Nginx lock|redirect url files
I am creating a url shortener in my subdomain ex: (go.domain.com) to serve as an external reference, example: // a url de uma pagina (extensa)…
-
0
votes1
answer1025
viewsA: How do I sign in to a PHP server to login to a separate application (HTML + JS) using Ajax?
The way would be yours PHP return session id to the application, in the application store this id to use for next requests. Example PHP: case 'auth': $sql = "SELECT * FROM users WHERE username = ?…
-
0
votes1
answer62
viewsA: Get Dominio for an unfinished website
To use the smtp Gmail using Phpmailer the procedure occurs in two ways: first: less secure (used on localhost during development or in domains without certificate): "Enable access to less secure…
-
2
votes2
answers4904
viewsA: Video call / video conference in PHP
I believe the scope of your question is to make "live stream" with technology like PHP. I have exactly the same question here at stackoverflow although the closest I came was using javascript. I…
-
2
votes2
answers182
viewsA: Load alternative image in case you don’t have the correct image
To run the code normally just reset "$player_img" if the reference does not point to an image on the server. // receber a referencia noralmente $player_img = "players/" . $row['LastName'] . "_" .…
phpanswered Lauro Moraes 3,871 -
3
votes4
answers2279
viewsA: Responsive image
The responsive image idea follows the concept of responsive design: serve the user the content view based on the display settings of your device. Since css still doesn’t make it possible to natively…
-
0
votes1
answer100
viewsA: Adding language manually
There are several ways to define different languages to the site. Perhaps the most recommended is to use Gettext a library GNU. An alternative way (and what use) is to use objects javascript and…
-
1
votes1
answer1872
viewsA: Generate unique name for file after upload
If it’s just generating a unique name you can use md5 and uniqid plus the timestamp ex: $novaimagem = md5(uniqid()) . '-' . time() . '.jpg'; // exemplo de saída:…
phpanswered Lauro Moraes 3,871 -
1
votes1
answer404
viewsQ: Configure Nginx for multiple Socket.IO servers
The idea here is to decentralize, make a load Balancing. In the following scenario: .1 a website serving multiple subdomains with Nginx .2 two or more servers nodejs spinning socket.io My need with…
-
0
votes1
answer1262
viewsA: Pick up json value
The problem lies in the fact that your json saved in the text document has an incorrect syntax or is not a json valid. I do not know how you save in text but after each object and before closing…
-
1
votes1
answer175
viewsA: How to return the dynamically inserted element id?
If the element was created dynamically use on of the element BODY instead of click and of course insert this id element containing the clickable class ex: $(body).on('click', '.excluir_registro',…
-
0
votes1
answer143
viewsA: Doubt about the structure of the Nodejs + Mongo app in Digital Ocean
Mongodb on the application’s own base server Running your own database is more interesting under the following aspect: Absolute control under the database and the data entered in it Possibility of a…
-
0
votes0
answers71
viewsQ: Error handling PHP session in Mongodb
I am using an Handler for php session in which you save the session data in Mongodb. However, while reloading the page at short intervals, it throws an error: "Failed to write Session data (user)"…
-
1
votes1
answer160
viewsQ: How to save php session in Mongodb and recover data in Nodejs
I’m running a server on php and another in nodejs trying to get a simple authentication since every session runs in php and nodejs simply processes some events however, and required authentication…
-
2
votes2
answers3587
viewsQ: Catch json values in Curl return
I have three different servers: server A, server B and server C. Where A registers users and stores personal information. I am trying to log in from B and C servers in A using Curl. I need to return…
-
1
votes0
answers55
viewsQ: How to create and connect users in new Rooms with soket.io
am using socket.io 1.3.5 and express 4.12.3 to create chat app in my script php, but I don’t know the logic of creating a new room when one user calls another. As kids: I know how to create a room…
-
0
votes1
answer430
viewsQ: How to return only the last result of more than one field of the same table?
I’m trying to make a PM’s system in php script I want to make a list of unread messages but I want to show only one entry (the last one) of each user I send a message...in the script I did shows all…
-
3
votes1
answer923
viewsQ: How to sort and filter queries between two tables?
I have two tables, one of posts (posts) and another of friends(Friends). In my script there is an area of feed where I would like to present the latest posts from the logged user’s friends. But…
-
7
votes2
answers17330
viewsQ: How to make basic live stream with HTML5 video API and PHP?
I would like to know the basics about how to create (make) a live stream system...I have a blog script in php where I created a system of users and even a system of friendships but I would like to…
-
0
votes1
answer2216
viewsQ: Pick up dynamic loaded element id
My script contains three parts: The first is the display page (e.g., home.php) on it I include two other pages. The second is a page that queries the database and displays the first 5 results (e.g.,…
-
3
votes3
answers1481
viewsQ: How to not show img element where src is equal to null
I’m making a system where the user can post images, texts, etc...but in the system every image posted should be uploaded to the server and the user can delete them. With the exclusion of the server…
-
0
votes3
answers2217
viewsA: Capture "textarea" from the Responsive WYSIWYG (text editor) plugin
You can capture the content that is in the "texteditor" ID with jQuery as long as it has content in it...: //Verifica se há conteúdo! if($('#texteditor').html() != ""){ //Cria uma variavel para…
-
3
votes1
answer129
viewsQ: jQuery external page Toggle effect via require or include PHP
I’m creating a user menu, it stays on a page the part that is incorporated to other pages like index and home for example. It assumes the role of a widget that is only shown if there is session…
-
2
votes1
answer964
viewsQ: View engine alternatives for nodejs?
Alternatives that are not Jade and similar, I try to know alternatives that can write the complete syntax (HTML and CSS)?
-
4
votes1
answer4437
viewsA: Integrate nodejs application to php site on separate servers?
Edited 12/09/2014 Good was a fight to find this answer so I share here! Example tested on localhost! Requirements see package.json! I used xampp as a local server, I don’t think it makes a…
-
3
votes1
answer4437
viewsQ: Integrate nodejs application to php site on separate servers?
How can I integrate an chat hosted in Heroku to my PHP project on another server? The application is simple and does not use database, the idea would be that in PHP when doing login automatically in…
-
1
votes1
answer1844
viewsQ: How to move element randomly across the screen (css or jquery)?
How to make an element move around the screen randomly by bouncing at the edges of the screen. Like those old DVD screen savers?!? The closest example I found my question was in css (keyframes,…
-
11
votes5
answers29209
viewsQ: Reset to input fields after Ubmit with Jquery
By sending input fields values via Jquery to a PHP page I can do the action without "refreshing" the main page but I can’t make input fields "empty" again?!? How to apply "reset" after submission?…
-
0
votes3
answers522
viewsA: Receive backgroud-image attribute from a div
I’m not sure what you’re looking for if you want to save the url in a variable, at this link! Maybe it’ll help you. $(function() { $("#senderscore").each(function() { var bg =…
-
0
votes3
answers823
viewsA: Do not receive the POST data
Try it like this: <?php session_start(); // error_reporting('1'); include 'config.php'; // username and password sent from form…
-
1
votes2
answers2177
viewsQ: How to change anchor links URL?
How to change that "#" sign of the anchored links? I am creating a slide menu in CSS and it is horrible this sign in the browser bar. Is there a workable solution? I read about the jQuery Address,…
-
4
votes2
answers156
viewsQ: Is it possible to have more than one CSS rule for an "img" in a "div"?
How to apply two (or more) CSS rules to elements img from within a div? I use the Tinymce editor and when I send an image for posting or messages (pms) I have to set in a specific measure for each…
-
2
votes2
answers1579
viewsQ: How to hide href with jQuery while input file is not selected?
I have a form image upload where the user before updating the avatar image or profile cover, views (in this same form) their registered image or a system pattern. Turns out my input type has an…