syntaxerror Posted September 20, 2007 Share Posted September 20, 2007 hi everyone, i've had more than a few years of programming... and only now did i get into web-based environment, or rather, web based programming envi. to make a more tangible inquiry let me site an example I've an entry form for a particular product line... it has 5 basic types... and tons of detail and related bill of materials one approach i can give here is to create a function for the layout of the page... with parameters for a number of inputs, and probably a couple of arrays... from there i can decide within the function on which configuration i can display an input page... at one end this does give me the advantage of maintaining the layout in one area( the function ), and apply any change easily to all configurations... but that's obviously the purpose of functions. however it worries me that php has to process this everytime, the page is requested by a client ( i'm not sure if i got that one right... i'm a rookie, admittedly). unlike coding for desktop executables that are compiled once. and the compiled version always available for execution by the users. Php seems to do the compiling of the page everytime the page is requested by a client(additionally, the creation and passing of variables, embedding the function into the calling page.. ) and i'm worried that it adds much load to the server( and i'm administering over a lan server machine that's already hosting another system and still acting as file server ). So it's pretty hard for me to gauge whether a 'common' block of code would be a good candidate for a function. ... hoping to get deeply intuitive responses from you guys, as always ( by the way, i think i tried to post this similar question but the php site seems to have undergone some repairs recently and i could no longer see if the post was registered ) (sorry guys, i did a more thorough search and yup i was successful posting it over a day ago (but surprisingly with no replies which is why could not find it in the link 'new replies to your post'... sorry, i am human, i do err Quote Link to comment https://forums.phpfreaks.com/topic/69995-how-to-evaluate-function-use-in-php-context/ Share on other sites More sharing options...
trq Posted September 20, 2007 Share Posted September 20, 2007 Wether your logic is processed within a function or not is a of little concern really PHP still needs to process it on each request. The concern that you describe is exactly what PHP was designed to do. You have little to worry about. Quote Link to comment https://forums.phpfreaks.com/topic/69995-how-to-evaluate-function-use-in-php-context/#findComment-351553 Share on other sites More sharing options...
syntaxerror Posted September 21, 2007 Author Share Posted September 21, 2007 should i presume that, making references to a couple more pages of grouped functions would not drag down my server? ... well that was were i was headed at some point when i decided to re-evaluate my approach... i was starting to get to a point where i might do 5 require_once for every page... Quote Link to comment https://forums.phpfreaks.com/topic/69995-how-to-evaluate-function-use-in-php-context/#findComment-352018 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.