Questions tagged as 'php'

2
answers

Problems with Curl result and file_get_contents

I'm trying to get an image from a website to use imagecreatefrompng (), but the result was never what I expected ... Url: link in the case when I call as <img> works perfectly <img src="https://www.habbo.com.br/habbo-i...
asked by 18.01.2017 / 14:16
1
answer

GetType () Laravel

I'm trying to get the column type of the tables from my BD , and how can I use PHP with Laravel I've tried using GetType to get the types and show on view . But the code is only returning Object . Here is t...
asked by 30.01.2017 / 14:11
1
answer

Prevention Session Hijacking

I know that to prevent this type of attack we must use session_regenerate_id (), especially before logging in. My question is if I should delete the previous session by passing a true as parameter? I understand that it would be best to delete th...
asked by 24.09.2014 / 18:23
1
answer

Session data in php

I am using an SSL certificate, and was wondering if it is possible for the user to see the data saved in the session? Example, I have a variable called config, where I save some user access settings. Can he change these qualities in any way?...
asked by 20.12.2016 / 11:51
1
answer

Is my code object-oriented?

I have a code and would like to know if it is an object-oriented code. Follow the structure. I work with 3 files. 1st call save.php , follow code: include_once('dao.php'); include_once('modelo.php'); $post = new Post(); $post->setD...
asked by 06.12.2016 / 18:42
1
answer

How to apply chmod 777 with php in main folder and several subfolders at the same time

I would like to know how I can apply with a single code in php chmod 777 in a folder and subfolders at one time in case I have a folder called images and inside it has 4 subfolders I need to perform chmod 777 on them with a single code instead o...
asked by 22.05.2015 / 16:50
1
answer

What is the difference between $ var and $$ var?

What is the difference between a $ var and $$ var variable in PHP? How can it be used? Can you cite some examples of use?     
asked by 01.05.2015 / 16:54
2
answers

How to prevent POST from outside the server?

I'm creating an application and I did not want some smart guy to think about changing the path of a POST html to send the values he wants, so I used a method in PHP: $referral=$_SERVER['HTTP_REFERER']; $origin="https://...
asked by 12.04.2015 / 10:12
2
answers

Static Methods in Factory Method

I'm creating a simple class using Factory Method and the following question came up for me. Is it good practice to use static methods in Factories? In many examples I found there, we have an instance of the Factory class, and I have not...
asked by 08.07.2014 / 14:53
1
answer

How to Create a New Account (Domain) via SSH?

Some time ago I asked a question - already resolved - about how to do an automatic update remotely using PHP ( See here ) Now I would like to create via SSH a new account on the server in order to replicate the system. In other words, the...
asked by 04.07.2014 / 20:58