Questions tagged as 'php'

2
answers

When to use and not use AJAX in submitting forms?

If I have a huge question form, would sending via AJAX be the best way? <form id="formulario" method="POST"> <!--vários Questionarios aqui--> </form> JavaScript: $.ajax({ type: "POST", data: $("#formulario")....
asked by 07.10.2015 / 16:07
4
answers

Reset in input fields after submit with Jquery

By sending the input field values through JQuery to a PHP page I can do the action without refreshing the main page, but I can not make the input fields "empty" again?!? How do I then apply the "reset" after submission? HTML: <div id='...
asked by 04.07.2014 / 16:44
1
answer

List files from a folder / directory in PHP of certain extensions

I need to list the files in a folder, and display them by name linked to their directory to download . I use this code: $pasta = 'uploads/'; $arquivos = glob("$pasta{*.jpg,*.JPG,*.png,*.gif,*.bmp}", GLOB_BRACE); foreach($arquivos as $img...
asked by 16.01.2016 / 13:10
1
answer

Friendly URL using HTACCESS

I have the following link: dominio.com/?p=filmes_v&m=tt081692 My .htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^film/?$ index.php?p=filmes [NC,L] RewriteRule ^film/([a-z0-9-]+)/?$ index.php?p=fi...
asked by 21.07.2015 / 21:33
8
answers

PHP echo Problem with special characters ("ç") [duplicate]

I'm developing a website that displays the names of months with strftime . The html is already with 'charset = UTF-8'. The problem is that the display of the month name appears as in the image below Ididalittletestbelowwiththenameofth...
asked by 07.03.2014 / 13:59
2
answers

How, when and where to use the magic methods of PHP? Get and Set? What's the difference? Should I use them in all classes I create?

I'm starting in OOP and would like to know when, where and how I should use the magic methods GET and SET and if possible to cite their differences in practice. Should I use them in all classes I create? How will I know if it is necessary or not...
asked by 12.03.2015 / 02:15
4
answers

How to check if the user is online?

I'm developing a project in PHP and using MySQL as a database. I only have one question about how to chat: How to know which users are online right now?     
asked by 17.03.2014 / 18:08
1
answer

upload without refresh with FormData, jquery

I need to update my script and I want to adapt my upload forms to be upados without the need to refresh. I did not use the script for third-party scripts so I searched and found this function of jQuery FormData . I did not rea...
asked by 09.12.2014 / 18:03
2
answers

Change table users Auth Laravel 5.1

I'm developing a system using Laravel 5.1 and I do not want to use tables in English. Actually I'm trying to keep the standard here in the company. I would like to know if I can use Auth or OAuth and change the table from users...
asked by 13.08.2015 / 17:32
5
answers

Currency formatting to save in the database as DECIMAL

I am using a mysql database, the field format is Decimal (7,2) and it receives the salary value. Based on what the user types I store in the bank like this: str_replace(',','.', $_POST['txtSalario']) Substituting the comma by period....
asked by 06.02.2014 / 13:21