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>
&...
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...
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...
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...
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 =>...
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...
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();...
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(...
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...
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...