View Full Version : Merging Scripts-Advice Needed.

12-06-2010, 05:09 PM
New to php. Got a few scripts for my app.

Login script

A script that returns a custom XML menu for the user

And a script that returns some url's for images.

My Question is:

Is it better to keep these scripts seperate, or merge them into one.

And if so, how do i call a particular function in a php script from a url?

12-06-2010, 05:51 PM
The organization of your scripts should be based on the roles they play. In best practice, you want to use MVC, so you'd have controllers, views, and models and your scripts would be organized as such.

Information in a URL can be extracted either by use of the $_GET superglobal array, or using PHP functions such as parse_url() (http://us2.php.net/manual/en/function.parse-url.php).