View Full Version : advice on Log in forms

05-28-2008, 04:23 PM
I am writing an application to manage pilots and I have the main index with an if statement that asks if the person is logged in and if true shows user info and if false shows log in block.

Now my question is, is it okay to leave the log in information with in the main page. It is pretty much the same code from DJ's Tut on log in scripts.


05-28-2008, 07:58 PM
Remember that my tutorials were intended to be a primer into PHP

you could use the login script in the main page as its not going to be used again however i would continue learning and think about reusing code.

if you have covered my tuts you will have a couple of database queries in your application well what if you stick all your php queries into one page which you can include into many pages and what if you turned one query into a function. You would pass in the SQL as an argument

05-28-2008, 09:26 PM
I took your tuts as a building like you intended, and I keep questioning what ifs and lol my project keeps getting bigger.

Though I was wonder about making the sql queries an include, though wouldnt that increase the time it takes to load everything because it would call all the queries at once? I am not sure of the answer and my assumption is that it would query the database for certain things that are not needed for the page its self.

thanks for the reponse

Though I dont understand this statement and I will go back and watch the functions tut
what if you turned one query into a function. You would pass in the SQL as an argument
what do you mean by pass the SQL as an argument?

05-28-2008, 09:50 PM
go and check out the functions tut