Questions tagged as 'php'

1
answer

Functions - Model, Controller

In my model I have this function that defines the format of the url: public function url_format_category($category, $lang_domin) { if (lang('abbr') == 'en_US') $lang_domin = 'en/'; else if (lang('abbr') == 'es_US') $la...
asked by 08.04.2015 / 20:18
1
answer

Update of Multiple Images

My code is currently playing its part well up and putting the watermark on upload images, but I would like to be storing the names of all images in the database. $idnoticia = $_GET['idnoticia']; $watermark = imagecreatefrompng('watermark.png'...
asked by 06.04.2015 / 15:17
1
answer

Module with multiple controllers in Zend 2

I'm having trouble creating a module with several controllers in Zend 2. It would be, for example: admin/user/ admin/user/add admin/user/edit admin/user/delete How do I adjust the routes for these URLs?     
asked by 03.04.2015 / 03:20
1
answer

Search results for an API in php / json

I'm using the following API: link This is a database of books / documents and I need to access it there to fetch some records. I already have the registry and a key to use. It's just that I've never done anything like it, and I do not see how...
asked by 20.11.2014 / 15:27
2
answers

Text Comparison

I'm having a question while comparing variables. I get a variable value in a string and need to compare it with another string . For example: $var1 = "M. D. AQUI"; $var2 = "MD AQUI"; // COM PONTUAÇÃO OU SEM PONTUAÇÃO. COM ES...
asked by 21.11.2014 / 12:45
1
answer

Treat Json Array in PHP

How do I get an item from an array in PHP. I have the following code: <?php if (isset($_POST['newUsers'])) { $newUsers = $_POST['newUsers']; foreach ($newUsers as $user) { $usr = json_decode($user); var_dump($use...
asked by 26.11.2014 / 14:02
1
answer

Call to undefined function pg_pconnect ()

I need to create a connection with a (already existing) database in PostgreSQL (Installed and working), using this code (which already existed already). File access_bd.php <?php function conecta() { $ip = $_SERVER['SERVER_ADD...
asked by 26.09.2014 / 17:05
2
answers

Is it possible to insert jQuery Validate in PHP?

For example, in my php code it looks like this: if( @$_SERVER['REQUEST_METHOD'] == 'POST' ) { $sobrenome = $_POST['sobrenome']; $erro = ''; if( $nome == 'Qual é o seu sobrenome' ) { $erro .= ''; } elseif ( strlen( $sobrenome...
asked by 08.11.2014 / 23:35
3
answers

Convert the date format the user types

Hello, I have the following code to format the date that the user informs and inserts in my bank: $arrayData['data_validade'] = date_format("Y-m-d",strtotime(str_replace('/','-',$this->$arrayData))); But, this date_format works only for t...
asked by 31.03.2015 / 15:30
1
answer

Problem presenting text in php with editor tinymce

I have a manager with the tinymce HTML editor, but every time I enter information in the database, when I present the page through PHP the text appears without paragraphs and with some tags in> I do not know why this happens. As you c...
asked by 31.03.2015 / 23:44