Posts by monosan • 176 points
8 posts
-
2
votes2
answers294
viewsA: Rule for redirecting with parameters
It’s been a long time since I’ve used Apache rewriting rules, but in your rule you’re mounting the URL with id and title, but the URL you’d like to get just has the title, so your rule can also only…
-
0
votes1
answer795
viewsA: List data only for a given ID
Try this: require_once 'conexao.php'; include("includes/header.php"); $result = mysql_query("SELECT nome, url FROM arquivos WHERE identificacao = {$_SESSION['usuario']}") or die(mysql_error());…
-
5
votes2
answers105
viewsA: What would be a parameter call before the string in a function
This resource is called Type Hinting. It serves to determine that a parameter needs to have a certain type. Before PHP 7, no scalar types were supported( int, float, bool and string ). In the…
-
3
votes2
answers483
viewsA: Media Query for PC
As far as I know, there is no way to know if the user is accessing the site through a desktop using only CSS...you can achieve this result using a little Javascript to detect the user’s device: var…
-
3
votes7
answers1682
viewsA: Make the class builder private?
Another use case for a private constructor would be to implement the Singleton Pattern design. By this standard, a class must have only one instance. To ensure this, the Singleton constructor is…
-
1
votes0
answers2370
viewsQ: Apache configuration problems
I am trying to deploy a project that is using Zend. This project is in a subfolder of the site( site.com/projects/project-name ). The site is in a VPS, to which I have root access. The server is…
-
0
votes3
answers10174
viewsA: How to Add and remove items from a json easily?
You can do this using the function delete. Take a look here. Tip: an id is a unique identifier. Do not use the same id for more than one different element.…
-
2
votes1
answer263
viewsA: How gives an infinite loop
You can solve this using the function set_time_limit PHP. Just pass the execution time of a script in seconds. This has nothing to do with the browser. The lock does not happen there, but on your…