Questions tagged as 'php'

1
answer

Database modeling, many-to-many relationship between two tables [closed]

I have 3 websites that will share the same database. There are 3 tables: News, Photo Gallery, Blog. It will only be a management system for the 3 websites. Example: The user will save news that belonged only to 2 websites. Question: What i...
asked by 26.05.2016 / 13:43
1
answer

Doubt with API facebook

I have a blog and I want to create a button for liking / sharing blog posts on facebook. Put the option for the person to enjoy and share the post over the comments of the blog. Is it possible to do this?     
asked by 25.10.2016 / 12:12
1
answer

How to value without pennies down?

How do I round out values that do not have cents and only have numbers? Ex: 10, 20, 30, 40, 50. If person has 13, get 10, if he has 25, get 20.     
asked by 20.05.2016 / 19:20
1
answer

Laravel Much to Many?

I have this model public function exercicio() { return $this->belongsToMany(Exercicio::class); } and public function treino() { return $this->belongsToMany(Treino::class); } My Controller public function salvarTreino(Re...
asked by 15.10.2016 / 00:30
1
answer

Function valid for all pages

Is it possible to define a function for all pages without using include() in all of them? Ex: I have a secret directory ../seg/staff/login/ and I want to define that user with permission level less than 3 can not access them....
asked by 13.10.2016 / 19:17
1
answer

I can not do SELECT

Model: public function exibir_noticia() { $consulta = $this->db->query('SELECT * FROM Noticia_Site_Cairu'); return $consulta->result(); } Controller public function index() { $this->load->model('noticia_model');...
asked by 13.10.2016 / 17:11
2
answers

PHP global array as temporary table

I'm in the middle of a problem, I'd like to use a array as a temporary table, more or less like this: $array = [ "codigo" => "0123", "descricao" => "produto" ]; But I would need it to be global , but I have many d...
asked by 13.10.2016 / 15:13
2
answers

HTTP Error 500 when putting a laravel5.1 project in production

I developed a project in Laravel 5.1. In Localhost everything works fine, but when I upload to the client server, which is not shared and is running PHP 5.6, it does not work. The HTTP ERROR 500 error appears. Can anyone help me?     
asked by 06.05.2016 / 00:42
1
answer

Laravel 5.2 $ errors empty

I'm using Laravel 5.2 and I'm trying to create a validation for user registration. In UserController.php I have: public function postSignUp(Request $request){ $this->validate($request, [ 'email' => 'required|email|unique:u...
asked by 10.05.2016 / 20:15
1
answer

Friendly URL with variable parameter

I have the following regular expression for Friendly URL: RewriteRule ^categoria/([a-z0-9-]+)/([a-z0-9-]+)/([a-z0-9-]+)/?$ categoria.php?idc=$1&nome=$2&pg=$3 [NC] I would like to leave the 3 parameter, pg, optional, have or have not...
asked by 14.05.2016 / 19:39