Questions tagged as 'php'

3
answers

How do I loop inside an image folder and resize it?

I have this class in PHP that when resized resizes the images contained in a folder. If you notice, the resizing is triggered by these instructions, one for each desired size. resize_and_crop('banner.jpg', 'banner_100x100.jpg', 100, 100);...
asked by 22.11.2015 / 20:19
4
answers

Expire link php

I'd like to know how I'd expire a link after a use. We have a password recovery system that sends an email to recovery that is working perfectly. In case, if the link does not open in 30 minutes, it expires, but I would like to know how to ma...
asked by 30.10.2015 / 14:56
3
answers

Convert string to utf-8

I need to transform a string into UTF-8 encoding. I'm stating it like this: $nome = utf8_encode($nome); And yet I can not find the error. The string looks like this: Consolação     
asked by 26.02.2014 / 20:50
4
answers

How not to write duplicate data in MySQL with PHP? [duplicate]

I'm learning PHP and for starters I'm doing a phone book project, with name, DDD, and phone. However, before the new data is entered, how do I check if the same phone number is already registered?     
asked by 27.03.2014 / 10:17
2
answers

Concurrent transactions in MySQL

I'm working on a system that needs to sort out multiple data (coupons) from one table and return it to the user, but I can not risk delivering the same coupon to the other user. I thought about using GET_LOCK ( ) from MySQL to temporarily l...
asked by 07.02.2014 / 19:20
4
answers

How to make an alert with animated echo?

How to make a more animated echo, I'm using the following PHP code, which contains a alert() of Javascript: session_start(); $credito = $_GET['credito']; $soma = @$_SESSION['valor_total'] += $_GET['valor']; if($soma > $credito){...
asked by 04.02.2014 / 19:21
3
answers

Is saving the user ID on COOKIES safe?

Saving ID of user to Cookies is safe as it is easy to see through the browser. My doubts are as follows: Is it safe to store% of user% in Cookies ? If it is not secure, what% method can I use? How can I be using it in PHP ?
asked by 22.04.2016 / 03:04
3
answers

Customize field name in validation error messages

I am using the Laravel 5.2 authentication standard Controlller: php artisan make:auth As the names are in English, I need to change to Portuguese. I already configured the locale for Portuguese, in /config/app.php : 'locale' => 'pt-BR...
asked by 07.03.2016 / 18:55
2
answers

Filling two equal inputs

Well I have the following problem, I have two inputs: Desconto<input type="text" name="desconto" id="desconto" style="width: 100px" > and Observação<input readonly="true" type="text" name="obs" id="obs" style="width: 400px; heig...
asked by 07.01.2016 / 18:05
2
answers

How to do a regular expression to remove only the hyphen without removing the hyphenated arrow

I have the following expression:    00000-001-> 22222-222 I would like it to look like this:    00000001- > 22222222 I've tried various ways on this site , but I'm not getting it.     
asked by 16.03.2016 / 15:57