Includes or not?
Posted: Wed Dec 01, 2004 4:14 pm
I just want some general advice really.
I've got a simple bit of PHP which I am using in the game I am designing and wonder the best way to utilise it.
I'm a very new PHP programmer so I know very little about things like includes etc.
The bit of code in question generates a random driver for the player (it's a motor racing game) and they will have a button/link to click on their team page to hire and fire drivers.
So when they click the button I want the code to be called, the driver displayed on the page and the data written to the database.
I could simply transfer the whole script over so it's all in one script but wondered if there was a more elegant way to do it, such as an includes or is it possible to have "external functions".
Any advice about which method is best is appreciated thanks.
I've got a simple bit of PHP which I am using in the game I am designing and wonder the best way to utilise it.
I'm a very new PHP programmer so I know very little about things like includes etc.
The bit of code in question generates a random driver for the player (it's a motor racing game) and they will have a button/link to click on their team page to hire and fire drivers.
So when they click the button I want the code to be called, the driver displayed on the page and the data written to the database.
I could simply transfer the whole script over so it's all in one script but wondered if there was a more elegant way to do it, such as an includes or is it possible to have "external functions".
Any advice about which method is best is appreciated thanks.