Posts by Thiago • 2,866 points
149 posts
-
1
votes3
answers1842
viewsQ: same div with different colors
How can I make a DIV change its color in the next instance of it? In two I can generate this effect:…
-
2
votes0
answers230
viewsQ: Efficient search with phrase and keywords
I am using the following syntax in SQL for searches: SELECT * FROM exemplo WHERE MATCH(title,content,tag) AGAINST(?) Regarding the LIKE I had a better result, but it is not yet 100%. for testing…
-
0
votes2
answers1458
viewsQ: Limit the size of an array
I have an array and will use it in two ways, in one I will use all the elements of this array, and in the other I will limit to , for example, 2 elements, ex: $array = ('nome'=>'Ribossomo',…
-
1
votes1
answer666
viewsQ: Like/Excuse button with AJAX
On a certain page I have a button/link written "Bookmark" <a href="SITE.COM/post/favoritar/ID" class="btn-favorite-normal">Favoritar</a> Where the ID is the post id, but anyway, I…
-
1
votes0
answers50
viewsQ: Good practices in calling javascript scripts
I have some pages that use specific javascript files/scripts and do not include in the header of the site, because not all pages would use it, I wonder if it is a good practice to include Js…
-
0
votes2
answers341
viewsQ: Dynamic like button
next, on the page of each post has a button for "favorite", as I can check if the post has already been liked and change the name of the button to, for example, "favorite" and if it is not, when…
-
1
votes3
answers347
viewsQ: Favorite facebook style button
How to create a favorite Facebook like button that after clicking is marked and sends the request to the database in background, something like this: The First button is the normal state and the…
-
5
votes1
answer803
viewsQ: Take a specific part of a string
I need to take a specific part of a log file, its structure is something like this: ################################################## ---------------------------------------- Nome: nome_user,…
-
2
votes3
answers16590
viewsQ: Align side-by-side fields in a form
I’m having trouble aligning 2 fields side by side in a form, the first case would be a select next to an input and, the other, two inputs. Ex: HTML: <li> <label>Selecione…
-
1
votes3
answers404
views -
1
votes1
answer75
viewsQ: Reset effects after clicking on a link
How can I reset all effects after clicking on a link to Ex, that underlined effect and the edge:…
-
0
votes1
answer617
viewsQ: How to remove dynamically selected images before Submit
I wonder how I can remove selected images from input file before sending them, I’m new in Javascript, I saw several examples, but without the implementation with the "Submit" button and I don’t know…
-
0
votes2
answers55
viewsQ: centralize "a" elements in a div
How do I center a "a" link horizontally and vertically in the center of a div? <div id="header_right"> <a>A</a> <a>B</a> <a>C</a> </div> CSS:…
-
0
votes1
answer37527
viewsQ: Pin header at top when scrolling page
A while ago I was looking for how to put header and footer fixed at the top and bottom of the page respectively, adjusting to the content that would be between the two, and I got with the following…
-
0
votes1
answer935
viewsQ: Internal Server Error with Htaccess File
It all started when I switched from Easyphp to Vertrigoserv, the file. htaccess worked perfectly on Easyphp , but here I am finding these problems... I have no idea how to solve this... HTACCESS…
-
3
votes1
answer318
viewsQ: Redirect all media requests(css,js and images) with htaccess
I am building an MVC application and was having some problems with the file path css,js and images no html... I was given a solution to use the tag <base> to define the path that all html…
-
2
votes1
answer550
viewsQ: Show div with enlarged image when mouse in thumbnail
I have a div where the thumbnails ( thumbnails) of the images are shown and another div above with the text, ex: How can I make so that when passing the mouse in the thumbnail (normal Hover effect)…
-
4
votes3
answers167
viewsQ: Alignment of Divs
I have 3 Div, and I’d like you to be willing as follows: To Div1 is the div who "holds" the other two. I would like the DIV2 stood over the DIV1 ,superimposing the text. And that the DIV3 remained…
-
1
votes0
answers183
viewsQ: Hover in thumbnail change image in div major
I have two div, one div minor thumbnail (small images) and other div major, that after the Hover effect I want to increase the size of the image in this div and overlay the text that is in it,…
-
2
votes1
answer9081
viewsQ: Align div in footer inside another div
I have a DIV content that includes another called Images, I would like div images to be at the bottom of div content with a certain space that I could define, ex: 400px, but this happens: I’d like…
-
8
votes6
answers16160
viewsQ: Format 9 and 8 digit phone numbers
I want to format phone numbers for the following formats: (XX) XXXX - XXX = 11 2222 3333 But as some new numbers come with DD + 9 digits, for example: (XX) XXXXX - XXXX = 11 22222 3333 How to format…
-
3
votes2
answers950
viewsQ: How to create Exceptions to handle statement with Mysqli
I’m migrating from PDO to Mysqli and when I was doing some operation with the bank, the verification block was like this: $query = $db->prepare("ppapapa sql sql"); try { $query -> execute();…
-
10
votes1
answer3509
viewsQ: Select with Prepared statements Mysqli
//// The connection is like Mysqli was passed by the constructor method and assigned the variable $db; public function getById($id) { $query = $this -> db -> prepare("SELECT * FROM tabela…
-
2
votes1
answer52
viewsQ: Mysqli cannot return methods
I am changing my PDO application to Mysqli since I will only use SQL even. I create the connection on the main controller so others can open it: class Controller { function __construct() { } public…
-
2
votes0
answers129
views -
0
votes1
answer133
viewsQ: Routing system bypassing subfolders
I’m using the routing system Altorouter, and its use is very simple, use this way: **** THIS IS THE INDEX.PHP ***** /*Incluo o arquivo do AltoRouter*/ include ('application/router.php'); $router =…
-
5
votes3
answers16389
viewsQ: Hover effect on one element affect another
I wonder how I can make the event :Hover in one element take effect in another... I have the following code: <ul> <a href="#"> <li> <div id="search-image"><img…
-
16
votes3
answers3152
viewsQ: When to use Setters and Getters?
I’m studying OOP and in the encapsulation part I had a question about when to use getters and setters, besides being able to validate the parameter passed, what is the usefulness of using? I could…
-
4
votes3
answers49868
viewsQ: Overwrite image with a DIV
How do I place a DIV over a <'img image'> ? HTML <div id="main-banner"> <img src="images/wall.jpg" /> <div id="main-banner-content"></div> </div> CSS #main-banner…
-
8
votes6
answers14224
viewsQ: Distribute list of <li> in two columns
I’m trying to create a list with 4 blocks, but they don’t align side-by-side correctly, they’re like this: I wish they’d stay that way: HTML: <li></li> <li></li>…
-
4
votes1
answer214
viewsQ: customize input for multiupload images
How can I customize a file input field for multiupload images? would like to get some information from the image, such as: format, size. (I know there are several plugins for this, but I would like…
-
1
votes2
answers3463
viewsQ: Attach elements to the footer of the div
I made some boxes using lists < ul> and < li> and would like to put a title and a "subtitle" in the footnote, which is the best way to do this? It’s like this: Ending: The HTML code…
-
8
votes3
answers44043
viewsQ: How to put icon inside input using Font Awesome?
I’m trying to make a search field with an icon using Font Awesome, I want it to look like this: but he gets like this: What is the best way to put the button within the input? HTML: <form>…
-
5
votes2
answers1344
viewsQ: Quote problem when doing INSERT SQL
I’m doing a CRUD with PDO, but the method query prepare() only works with "crooked quotes" Ex (that’s how it works): "INSERT INTO `_user` (`firstname`) VALUES ('blabla')" It doesn’t work anymore:…
-
0
votes1
answer2188
views -
1
votes1
answer1324
viewsQ: The standard MVC Model class in PHP
I am studying MVC, I created the abstract Model class to serve as a "template" for the others who can inherit it. I would like an evaluation of the code as, positive and negative points, how best to…
-
4
votes2
answers1064
viewsQ: When to use cache system in PHP?
I’ve been reading a little about the use of PHP cache, its advantages and disadvantages. Some questions and etc. If I have a system that only shows updated texts (rewrites) of the same, very small,…
-
1
votes0
answers33
viewsQ: Problem with web fonts in multiple browsers
I’m using the font Open Sans of google and the font Awesome, but the results are different in some browsers, only getting "perfect" in firefox, ex: How can I fix this?…
-
2
votes2
answers264
viewsQ: Single database instance
I have a controller and need to access 2 or more tables from my database, ex: $userModel = loadModel('userModel'); $userModel->setTable('users'); $userModel->getAllUser(); $outroModel =…
-
2
votes2
answers491
viewsQ: Best Way to Pass Data to All MVC Controllers
After logging in via controller LOGIN, a Session is created with the ID of that user in the system, from that ID can give a "fetch" with all your information, the big problem is that when you log in…
-
4
votes1
answer1237
viewsQ: Problem passing parameter via GET MVC
I can’t get the figures by GET within a controller or action, example: Doesn’t work: example.com/controller/?q=nome example.com/controller/action/?q=nome Works: example.com/?q=nome Note: POST type…
-
0
votes2
answers251
viewsQ: Apache Forbidden 403 at Elementary OS
After updating my PHP/APACHE I can no longer access my projects through the browser, keeps returning the Error Forbidden 403. Information on the environment: PHP 5.5.12-1+deb.sury.org~precise+1…
-
4
votes2
answers156
viewsQ: Why do I have to assign the value of the prepare method to a variable and only then instantiate execute? in Pdo
Ex: $stmt = $db->prepare("SELECT * FROM BD"); $stmt->execute(); Why doesn’t it work if I instantiate the execute method from the same instance? since the value has already been passed to the…
-
3
votes2
answers654
viewsQ: Problem decrypting hash in Base64
I was reading about an apache rule for validating permissions to access files/directories, and saw that the default file that reads the user and password was: usuário:senha (sendo a senha em…
-
2
votes1
answer1095
viewsQ: How to pass data to all views in a MVC pattern?
I’m building a small MVC application with PHP, following directory structure: controllers/ (Controller files) views/ (View files) In each controller, I pass an instance of the Object VIEW with an…
-
3
votes4
answers1241
viewsQ: Problem in CSS and JS path in MVC project
I am building a php application with MVC, the problem is when accessing other directories by URL, Ex: mvc/user (so far all right) now: mvc/user/create (here the css style sheet and javascript are no…
-
-1
votes2
answers177
viewsQ: Problem with Case Sensitive
I am building a small application in MVC, for didactic purposes, I did most in Windows, when I passed my scripts to Elementary Os, many errors were appearing, including files and etc, these errors…
-
5
votes1
answer3509
views -
3
votes1
answer202
viewsQ: How to bypass an HTTP redirect?
Is there any way to do a "bypass" and access the page? For example: if(!isset($variavel)) { header ('Location: error.php'); } else { echo 'oi'; }