Jump to content
xisto Community
Sign in to follow this  
Samleeuwenburg

Structuring A Php Website With Css Layout what is a common way to get this kind of thing done

Recommended Posts

With the method I mean the way im using those functions (require())

Well, when you get to the point that you are competent enough in PHP for making the complex scripts you mentioned, you will be using at least require(), for you can't have everything all in one page. As you should have received some insight from already in this topic, one of the things you should be learning is how to structure your script. require() and include() help bring things not only within the global scope of your script but also the local scope (depending on how you include them and are put to use). A hint to structuring your script: Try to separate whatever seems reasonable to do so. For example, say you want a lot of specific variables, even constants, to be accessible throughout your entire script, you could place them in for example, globals.php; or functions, functions.php. The point to this is that it will be easier to maintain your code.

 

When including scripts, i would recommend using require_once() or include_once() instead of require() and include(). These not only help prevent unnecessary inclusions but will also help prevent recursive inclusions. While the recursive inclusion may be due to the fact that the script layout was laid out improperly (at least concerning PHP), there may still be a case where two files depend on each other. In this case, require_once() and include_once() may prevent you from noticing any flawed layouts, it at least allows you to continue being productive without having to worry about the potential recursion. Also, there may be a case where you would want to include the same script twice on the same page. In this case, require_once() and include_once() would be unreasonable.

Share this post


Link to post
Share on other sites

with a quick look at your script, the structure is right now. you are on the right way. about your project if you have a problem in creating a log in script. then search the net for login scripts and see how it works, step by step you wll make your own one, good luck.

Share this post


Link to post
Share on other sites

with a quick look at your script, the structure is right now. you are on the right way. about your project if you have a problem in creating a log in script. then search the net for login scripts and see how it works, step by step you wll make your own one, good luck.

check it out: http://forums.xisto.com/no_longer_exists/. ( login system ).

Took me a while to make since most tutorials don't explain it well enough and many don't work. But I think I get it now.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.