Create dynamic pages[NOT SOLVED]
Moderator: General Moderators
Create dynamic pages[NOT SOLVED]
Hi all, I need to create php page (if u have best way, write) which will show another content depending on a request. For example, site.com/account and site.com/account?settings must show another pages (with significant differences!). What is a best way to solve this problem? I need to create ramification with setting request and with no this?
Last edited by bagi on Fri Nov 01, 2013 1:52 pm, edited 1 time in total.
Re: Create dynamic pages
Sounds like you want a front controller to capture all incoming requests and then route them as needed.
Re: Create dynamic pages
Yes, but I don't understand it on my example.
If i have a request I need to create a ramification witch will handle that?
For example
and ect. I right understood this approach?
If i have a request I need to create a ramification witch will handle that?
For example
Code: Select all
if($command == "showProfile"){/*showing a profile*/}
else if($command == "saveSettings")//now we saving inputted settings
Re: Create dynamic pages
And is a good way to store all functions in one php file and include that in each file?
Re: Create dynamic pages[NOT SOLVED]
Code: Select all
switch ($_GET['command']){
case 'showProfile':
include('profile.php');
break;
case 'saveSettings':
include('savesettings.php');
break;
}. . .and sometimes it makes sense to store all functions in one php file, unless it will load a lot of unneeded code in some pages.