Questions tagged as 'php'

1
answer

Pagination script PHP [duplicate]

I would like to know how I can perform pagination in PHP (in this case 10 items per page). The display is being made this way: <?php foreach($pdo->query('SELECT * FROM videos ORDER BY id DESC') as $c): ?> <li> &...
asked by 27.10.2015 / 15:49
2
answers

Deleting data automatically after a certain time

Example: I have a table with three fields: id int pk, varchar name, int category The category field can receive 2 values: 1 and 2; By default always when a data is entered it will have a category 1. What I want is this. When a data is e...
asked by 27.11.2015 / 20:32
4
answers

Format 9- and 8-digit telephone 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 fill in empty spaces with zeros or...
asked by 18.10.2015 / 19:08
1
answer

Ternário reduced in PHP - Error or misinterpreted?

Looking at the manual we have this description:    'The expression (expr1)? (expr2): evaluates to expr2 if expr1 evaluates to TRUE, and expr3 if expr1 evaluates to FALSE.   Since PHP 5.3, it is possible to leave the middle part of the ternary...
asked by 23.04.2015 / 22:05
2
answers

Regular expression to reorder string

I have the result of a query with several joins , and in a row I have the concatenation of 2 groups. The line returns a string as: 1,4|a1,b4 . What I need is to regroup ID and Value as follows: array( 1 => a1 , 4 =>...
asked by 20.11.2015 / 01:49
3
answers

Login system

I made a site where I have implemented this file that belongs to the login but it does not work for me <script type="text/javascript"> function loginsuccessufully(){ setTimeout("window.location='backoffice/view.php'", 3000); } fun...
asked by 24.04.2014 / 15:45
1
answer

Send bulk email using Amazon SES

I'm developing a system that should send bulk emails using the Amazon SES service. How the upload is done To send mail, I'm using PHP Mailer, with the following code: $mail = new PHPMailer; $mail->isSMTP();...
asked by 20.03.2014 / 17:55
2
answers

How does the file receive the $ _POST?

Good morning, I have to do maintenance on an old form and I'm trying to understand how it works ... Below the file form_proposta.php <? $msg = "Mais informações de imóvel enviado em " . date("d/m/Y") . ", os dados seguem abaixo: " . chr(...
asked by 22.09.2014 / 15:09
3
answers

How to group records by time zone?

I have a table in MySQL, which stores the visits on my site, taking as fields: id | ip | date , with date of type DATETIME . What I need is to separate these visits by peak times. Example: Das 10:00 às 12:00 | 500 visitas Da...
asked by 16.03.2014 / 22:29
2
answers

How to develop a private RESTFull API?

I need to develop a RESTFull HTTP API in PHP to serve as authentication for users of an Android application, the problem is that since it is a public distribution application I can not define any key in the code as for example: basic authenticat...
asked by 21.10.2014 / 20:35