Questions tagged as 'php'

1
answer

What is the best practice for restricting access to the site administration system?

I wanted to create an administration system for the site, I made it so that users have a level field associated with it and if it is a given value they can access the admin control, otherwise if they try they are directed to the index, I do not...
asked by 14.05.2015 / 23:43
1
answer

Should I use DIRECTORY_SEPARATOR or BAR (/)?

I usually tinker with the framework source code, as in the case of Laravel to see how structures are made. I noticed something interesting in Laravel 4 in relation to Laravel 3 . In Laravel 3 , you use, to mount directory paths, the con...
asked by 06.07.2015 / 18:03
2
answers

I can not check if an array is empty or null

I need to display a message whenever my array is empty or null, but I can not. I call the JS function in PHP by passing an array with json_encode. It works perfectly, but it does not check if the array is empty. php file:      $nGals = $con...
asked by 27.06.2015 / 21:15
2
answers

Give same value independent of the order

I needed to somehow generate a hash from a string but the same hash is obtained regardless of the order of the two strings 1234+4321 = asdfghjkl 4321+1234 = asdfghjkl Is this possible with PHP?     
asked by 02.07.2015 / 01:15
2
answers

Remove messages from one party without affecting the other

I am implementing a messaging system and need to make a way to remove the messages from one caller without affecting the other. Fulano and Sicrano exchange messages: At one point, So-and-so removes the conversation, but Sicrano continues...
asked by 23.06.2015 / 01:13
1
answer

How to redirect through a notification?

I'm sending notifications to registered users through Facebook about new events. How do I redirect the user to the event URL sent through the Facebook API? private function sendNotification($userFbId, $message, $url){ $attachment = array(...
asked by 03.07.2015 / 22:16
2
answers

Error while uploading photo

I tried to apply the instructions to upload photos to the bank with this article . I have just adapted to the MySQLi extension. The connection code below: $conecta = new MySQLi = ("localhost", "root", "", "forum-ti-1"); However, the fol...
asked by 27.05.2015 / 21:12
2
answers

Friendly URL, images do not appear even putting absolute path

I'm facing this problem with my friendly URL, even putting the absolute path does not show the images. However the images that are in a folder in the same location as .htacess usually appear, the ones that do not appear are the ones in th...
asked by 25.09.2015 / 19:15
1
answer

Get the ID of the last line entered in the database

I'm doing a project that is in the following form: First the person will upload the photo of her in the bd (Table: registered, field: photo) But in this table there are other fields, so I created a form that will change the last line and add...
asked by 01.10.2015 / 01:31
2
answers

How to make an XMLHTTPRequest to send values to the page itself?

What I have: I created several buttons through PHP and to distinguish them I used the $botoes_criados variable. So I have the value of the $botoes_criados variable in PHP that is passed to a button as follows: echo("<li&g...
asked by 02.10.2015 / 10:58