Jump to content
Larry Ullman's Book Forums

Recommended Posts

I am trying to understand how functions.php works..

i don't understand well, function is-administrator() .

When we login,at login.php , we always have to give same email and password that's written in the script to login,otherwise it fails to login. so is that the admin? if so, why check every time?

  and cookies are bit confusing! are they just random values.. they are linked only to admin?

 

if other than admin logs in, how is it going to work with login.php page? guess it wont lets in,right?

 

and mysqli_connect.php file, I can save it outside xampp/htdoc,,?

like just at any other folder at C:\test\mysqli_connect.php ?

 

Link to comment
Share on other sites

Re: cookies et al., I think the important point is that HTML is a stateless technology, meaning that each page view is a separate request and there's no way to know that the user that just logged in is the same user seeing this page now. This is why the cookie is used: to track the user. And then is_administrator() uses the cookie.

 

Correct: no one else can log in (with other values). And no one not logged in can access admin content.

 

As for mysqli_connect.php, you could put it in C:\test but I'd use something like C:\xampp\test so it's relatively tied to the web server stuff. 

Link to comment
Share on other sites

 Share

×
×
  • Create New...