Questions tagged as 'php'

1
answer

Error handling in consultation

How can I make error handling in this scenario and if there are errors, for example in connection or declaration, display them on the screen? returnClient.php <?php $hostname="localhost"; $username="USUARIO";...
asked by 13.09.2018 / 15:44
1
answer

File There is PHP

I'm using this function to check if the file exists: <?php header('Content-Type: text/html; charset=utf-8'); //header('Accept-Ranges: bytes'); $nome_real = $_FILES["Arquivo"]["name"]; $pastadestino = "/pasta/$nome_real";...
asked by 24.11.2015 / 03:15
2
answers

Is it safe to use the $ _SERVER variables to log errors?

We all know that it is possible to manipulate some information during a request, I never had to use anything like $_SERVER[HTTP_HOST] , $_SERVER[REQUEST_URI] or $_SERVER['REMOTE_ADDR'] because I know it has security implicati...
asked by 23.11.2015 / 13:44
2
answers

Report error while performing UPDATE with SQL

I have a project, in which the administrator can change registered data of tables, but if the query is executed but no change occurs, I would like to return a message or error, here is what I have so far: $altera = "UPDATE z SET y= a WHERE x= x...
asked by 16.11.2015 / 23:20
2
answers

Find string inside a php tag

When using in several types of embed from several sites, and go get only the link. For example: Youtube: <iframe width="420" height="315" src="https://www.youtube.com/embed/HLhuNbO0egU"frameborder="0" allowfullscreen></iframe>...
asked by 23.11.2015 / 11:11
2
answers

How to make a date in full on common date?

I get a string with a date, and unfortunately there's no way to change it, in the format:    September 1, 2015 And make it into:    01/09/2015 The only way I found to do this would be by breaking the string and forming an array, an...
asked by 01.09.2015 / 17:57
2
answers

Form security

I have the following code: PHP (server): if(isset($_POST['subdate']) && !empty($_POST['date'])) { $daysOff = array(); $get_date = explode(',', $_POST['date']); foreach ($get_date as $date) { $date = explode('-', $date...
asked by 09.09.2015 / 13:01
2
answers

Folder navigation in PHP

I have some folders in my project and I need to go through all of them by saving the name of the mother folder, the daughter, and their files ... The parent folder is "Manual", inside it I have other folders "Register" and "Reports", in these...
asked by 31.08.2015 / 19:14
1
answer

Pass data in php constructor to class

I have a question about how to submit data for creating a goal, I read in some tutorials that it was just put this way in PHP4: $elo1=new Elo(1300); $elo1->fc_Elo(); But the way I saw it on some web sites, the code is too long, does it h...
asked by 18.09.2015 / 03:31
1
answer

How do I add attributes in the img with the_post_thumbnail's WordPress function?

I need to add width="100%" and class="img-responsive" . How do I add to the img if I call it in the index this way? <?php the_post_thumbnail(); ?>     
asked by 10.09.2015 / 07:30