Questions tagged as 'php'

4
answers

Convert date format to php

I'm working with Wordpress php and I get from the database a date in the following format: "October 22, 2018", plus I need to convert it to "2018-10-22", How do I get this? I tried: date('Y-m-d', strtotime(get_post_meta( $id_pedido, "Data de...
asked by 23.10.2018 / 19:35
1
answer

Validation of the strings size

I was creating a function to validate large text fields (description, observation, ...), which in SQL will be saved as TEXT , so basically I did this: function($valor, $min = 0, $max = 65000) { if (strlen($valor) >= $min || strlen...
asked by 28.09.2018 / 15:37
1
answer

Pull several images of the same id in bd

I'm having a hard time pulling into the front end 4 images of the same id I have in the database. I was able to normally insert the images into the database, I am using two different tables. Follow the database below the first one: Tabe...
asked by 16.10.2018 / 16:39
1
answer

Get the days of the current week PHP

How can I get the days of the current week? Eg This week I would like to show the following sentence:    Events from the 15th to the 19th of October While on 16/10, continue showing from the 15th to the 19th of October. I tried the code b...
asked by 15.10.2018 / 17:18
1
answer

How to do a bypass in an HTTP redirect?

Is there any way to do a bypass and access the page? For example: if(!isset($variavel)) { header ('Location: error.php'); } else { echo 'oi'; }     
asked by 06.03.2014 / 04:47
4
answers

Query data in the bank according to the date

Querying data in mysql in the last 3 days, that is, displaying data from the bank from day 15 to today (2/17/2014) I'm using it like this: $condicaoData = date('d/m/Y', strtotime("-3 days")); $selecionaTabela = mysql_query("SELECT * FROM no...
asked by 17.02.2014 / 14:27
2
answers

How to build friendly URLs, such as Facebook and Twitter.

I have a question, how can I build links like Facebook and Twitter? For example: http://facebook.com/nome-qualquer . I know that .htaccess treats the url in some way, but the question I'm beating is how to load the contents of ur...
asked by 13.03.2014 / 21:21
1
answer

PHP decoding of characters in an IMAP connection

Introduction I'm working on an email box where I'll later have to filter the messages by senders. But the problem is in the coding of some "subjects". I make a connection to the mail server through the imap_open function; $mail_box =...
asked by 12.09.2018 / 16:07
3
answers

how to treat different index / templates for the same site?

I have 10 distinct html / php templates and via panel (admin) the client can select one of the 10 templates for his site. My question is how to get the website to know which template to open. In the panel I save the selected template in the d...
asked by 18.01.2015 / 20:11
2
answers

Showing the result according to the load and not waiting for the script to finish displaying the results on the screen

My question is as follows: the code is working as expected the problem when I put a large email list (100) the page gets all in white "loading" and only returns me the result after the script ends to be executed, I need a solution that allows me...
asked by 12.01.2015 / 02:40