Questions tagged as 'php'

7
answers

PDO does not connect to MySQL

I'm trying to make a connection to the database via PDO, but every time I try to make that connection, the following message appears: could not find driver I went back to know and I knew that I had to enable the PDO in php.ini. Okay, I went...
asked by 09.02.2014 / 19:29
1
answer

Catch the text between a tag

I have this string <td id="aui_3_2_0_1196">500</td> , I'd like to get the value 500 between the start and end tag ( <td id="aui_3_2_0_1196"> and </td> ).     
asked by 05.11.2016 / 04:31
2
answers

Is it possible to create a "synonym" of one function, two names for the same function?

I have a set of functions using a third-party API. From time to time I thought of making it available, since there is no public library in PHP and it makes no difference to keep it as a closed code or not. ( I will still have to change a lot. )...
asked by 29.07.2016 / 21:59
5
answers

How to redirect php pages

I have a login system in a PHP program that I want it to forwards users to different pages depending on your profile. There is a login table that has a field named " perfil " which is either 0 or 1 . The goal is to rout...
asked by 16.06.2016 / 13:35
2
answers

How to sort this php array?

I have this array: $res = array(); $res[] = array("16/08/2013", "13:32", "ROBERTO"); $res[] = array("16/08/2013", "13:16", "AMANDA"); $res[] = array("14/08/2013", "12:36", "SILMARA"); $res[] = array("14/08/2013", "", "ROBERTO"); $res[] = array...
asked by 09.07.2016 / 23:25
2
answers

Declare public variables in the __construct

Look at the example method: <?php #noticia_construct.class.php class Noticia{ public $titulo; // Acredito que não seja necessário public $texto; // Acredito que não seja necessário function __construct($valor_tit, $valor_txt){...
asked by 02.11.2016 / 19:02
2
answers

How does alert show when checking checkbox in a table?

I have a table: Theinformationshownissearchedinthebank,andonthesideofthecolumn(inthisexample)-Salary-willhaveacolumncalledLock/Unlock-whereIcanlockthatinformationinthebankfrom0to1)andsobeforethename-exampleAshtonCoxwillhaveagreeniconthatmean...
asked by 14.06.2016 / 17:21
1
answer

PHP - Why should I put an IF in mysqli_prepare ()

In the example discussed in the PHP Manual , if instructions. I know that if is used for comparisons, what comparison is being made here? Here is an example from the website below: <?php $mysqli = new mysqli("localhost", "my_user", "my...
asked by 26.07.2016 / 20:46
3
answers

Search Postcode Post

I'm trying to implement a php implementation via simplexml_load_file to check and return data to the Post API. In this case, it is necessary to pass variables in url . I'm doing this: I'm doing this: function encontraCep...
asked by 25.05.2016 / 14:41
2
answers

addslashes is the basics for security? [duplicate]

I have a site with login system, where you will find a forum with comments. I wanted to know if the addslashes function would be at least the basics to prevent malicious code, such as page redirection, sql injection?     
asked by 31.03.2016 / 23:49