Howdy. This is one concept of php that I'm fairly new to - and its hard to describe in google so I can't find results. Is it possible to have a single page which can show many different screens which exist in functions so the screen doesn't really refresh in the typical sense ? i.e. this-webpage.php (function with page a) (function with page b) (function with page c) I'm not sure if there would be problems with headers being sent or anything of that nature. Is this possible and if so, could anyone provide a little example please ? Many thanks.
You might want to look into AJAX. You could also do this with javascript using hidden divs. Also JQUERY which has some cool tabbing stuff.
Thanks. I'll have a gander at those options. I am thinking of modifying some separate pages that are already written in php but do a lot of redirecting (which isn't as clean as I'd like it to be).. I was hoping to kind of amalgamate them into functions within one page. If I were to attempt it in php, is it possible ?
I would think you'd use a javascript handler to call your php scripts via AJAX to display on the current page, but it really depends on what your scripts are doing.
ajax is the best way to do it. check that tutorial on w3schools http://www.w3schools.com/Ajax/Default.Asp
You can break from PHP and begin to output plain HTML inside of PHP functions. Then, you can break back into PHP inside of the plain HTML again, as many times as you like. As long as all of the output is inside the function brackets {} there is no problem. Example: <?php function page($data) { //do something with data, like retrieve information from database; ?> <html> <head> <title><?=$title?></titl> <meta name="description" content="<?=$meta_d?>" /> </head> <body> <div id="wrapper"> <div id="main"> <?php // do something related to the main content ?> </div> <div id="sidebar"> <?php // do something related to the sidebar ?> </div> </div> </body> <?php } //end of function ?> PHP: I find this a bit silly, but it is certainly possible.