Questions tagged as 'php'

4
answers

How do I generate a summary or excerpt of each post?

I am wanting to build a php and javascript post system, I already know the admin will write the post, post the subject, category the date goes automatic and inserted in the database. This part I already know how to do, but wanted to know how I c...
asked by 28.04.2015 / 02:19
2
answers

$ _GET ['id'] does not return value

I do a search with in mysql, but the $ _GET ['id'] does not show, although it shows in the address bar: link $ id = 18 $sql = mysqli_query($conexao, "SELECT * FROM produtos WHERE id= '". $_GET['id'] ."'"); Why does not the id number r...
asked by 28.04.2015 / 21:12
1
answer

Place part in parentheses

I have this code: if(isset($params['bedrooms']) && is_numeric($params['bedrooms']) && $params['bedrooms'] > 0){ $what['bedrooms >= ?'] = $params['bedrooms']; $what_or['suites >= ?'] = $params['bedrooms']; }...
asked by 07.05.2015 / 15:58
1
answer

Wrong file size

Hello, I would like to know how I can fix the following error: I have the code below, which gives the file size, querying inside the host directory. However, let's say the file has 800Mbs, so what happens is that it shows a value a little lowe...
asked by 04.05.2015 / 06:14
1
answer

How "preg_match" only numbers?

My failed attempt: $post_id = preg_match("/^[0-9]+$/", $_POST['post_id']);    I tried to be a user who changed the post id for example: post_id="43223646", but when the data is entered in mysql, they are transformed into the number 1, how...
asked by 27.04.2015 / 13:44
2
answers

How to make a SQL query that returns an object instead of an array?

There is not much to talk about. What I need is to know how to do a query that returns an object to me instead of an array in the format: $eventos = [ new Evento(1, new \DateTime('2015-01-26'), 'Titulo #1'), new Evento(2, new \DateTime...
asked by 21.09.2015 / 16:26
1
answer

Insert value in array in a given position through a conditional

I have the following array: array(143) { [0]=> string(0) "" [1]=> string(0) "" [2]=> string(5) "item1" [3]=> string(5) "item2" [4]=> string(5) "item3" } and my following logic to find a value in the array: $abaixo...
asked by 24.09.2015 / 15:17
4
answers

How to view files without underline?

I need to display images in elements img of HTML using as value of src attribute the address of the file retrieved through the function glob() . The problem is that it does not work with underline file addresses. $arquivos =...
asked by 14.08.2015 / 21:04
2
answers

How to force download via remote url to any type of file [duplicate]

I would like to know how I can force the download via remote url to any type of file being my priority in case I force download of video media files online. Like for example of this url in question url of mentioned here I thank you for be...
asked by 25.08.2015 / 06:32
4
answers

Is there any way to show the result of a query (mysqli) in the form of HTML?

I have already looked intensively for a solution to show the result of a mysqli query within an html, but I can not find anything. I saw that it is possible to present the result through one with the help of fetch_assoc () in php, but what I wan...
asked by 26.08.2015 / 23:58