Questions tagged as 'php'

1
answer

Is there a built-in server in php?

Sometimes we want to run a simple PHP script for testing, but we do not want to spend time installing wamp , xampp or even installing apache2 followed by PHP. Is there any way to run the script in PHP, with some simple ser...
asked by 12.09.2015 / 18:58
2
answers

Why does the User-Agent header always return "Mozilla /5.0" regardless of browser?

I know that in PHP we can access a header called User-Agent and thus discover information about the operating system and browser, used by the client. The only thing I do not understand is that "Mozilla /5.0" always appears (even...
asked by 09.09.2015 / 13:57
2
answers

Doubt with method and property visibility in PHP

What is the purpose of declaring functions started underline? Eventually I wonder why. For example: protected function _exemplo() {} Is not that enough to declare? protected function exemplo() {} Is there any other specific reaso...
asked by 15.07.2014 / 15:37
4
answers

PHP class for interaction with BD MySQL

Does anyone know of any PHP class for MySQL integration, using the mysqli_* and prepared statements function? I have these two examples here: MysqliDb MySQL Database
asked by 04.07.2014 / 16:16
1
answer

Filter first result

Is there any way to filter the first result of a query in php? Example: $query = mysql_query("SELECT * FROM teste2 ORDER BY 'id' DESC") or die(mysql_error()); while ($row = mysql_fetch_array($query)) { if (RESULTADO == PRIMEIRO RESULTADO)...
asked by 28.06.2014 / 02:43
3
answers

How to break lines when sending an email?

How do I break lines in an email that will be sent via PHP ?    If I use <br/> it works only if the email arrives in the spam box. Part of the PHP code: if(count($errors) == 0){ $user = get_userdata( $status );...
asked by 08.07.2014 / 02:37
1
answer

JSON generated by json_encode gives error in character "{"

I do not understand what's happening, I'm using a json_encode function in PHP and what does it return is invalid?! I'm using jsonlint as the validator, and it states that the error is in the first { . If I replace this characte...
asked by 10.12.2014 / 18:51
2
answers

My SessionHandler will not allow me to login

I'm using this sessionHandler as my sessionHandler . The problem is that since I'm using it I can not initialize / log off. index.php include_once( 'sessionHandler.php' ); $sessionHandler = new SessionSaveHandler(USER_NAME, PA...
asked by 02.12.2014 / 13:30
2
answers

Capture div by class

I'm trying to capture a div from its class, but I did not succeed, note: I try to capture the div with the class class='m-definicao-conteudo' of the site that I report to curl, but I get this error:    Warning:   DOMDocument :: loadHT...
asked by 21.12.2014 / 05:03
2
answers

Refresh the content of a page without reloading it

I'm working on a college project where I'd like to refresh the content of a page without reloading it. The page in question has its content received from a PHP script, which in turn takes the content to a MySQL database. This is...
asked by 18.09.2014 / 14:16