Jump to content
Larry Ullman's Book Forums

Chapter 11: Show_Image.Php, Function.Js, And Images.Php Help


Recommended Posts

I guess the term I'm using is a little off. What I mean is, can I use that method to display other user pictures in a social networking site like facebook or myspace?

 

Hey do you know what Larry mean by the sentence below? What does he mean by independent?

 

function check_login($dbc, $email = '', $pass = '') {

 

Although this function could access $_POST['email'] and $_POST['pass'] directly, it’s better if the function is passed these values, making the function more independent.

Link to comment
Share on other sites

I'm not sure about Myspace, but Facebook is a walled garden, meaning that they have exclusive control over all the content on their site (i.e., they're not going to just let you access other people's photos, etc. for free).

 

With that said, there is a Facebook API available, which does give you some access, I believe, but in order to do that, I think you need to be friends with the users or something to that effect.

To be honest, I quit Facebook a couple years ago and never looked back, so I have no idea what their policies and API are like these days. That would require more exploration on your part, but gauging by you general level of knowledge with PHP, etc., I probably wouldn't even attempt such things right now.

 

Furthermore, you need to consider the moral and legal ramifications of dealing with such content.

In other words, please be careful.

Link to comment
Share on other sites

Although this function could access $_POST['email'] and $_POST['pass'] directly, it’s better if the function is passed these values, making the function more independent.

The function handles the login process. Larry is saying that the function could use the $_POST values to check the user's credentials but that it is better/more secure to pass the values in variables when the function is called.

Link to comment
Share on other sites

margaux, my interpretation of what Larry said is that by passing the $_POST array values to the function as arguments, you are making the function more flexible in that it could be used in other cases as well (i.e., cases in which you aren't using the $_POST array, but just regular variables/values instead).

Link to comment
Share on other sites

 Share

×
×
  • Create New...