NikkiLoveGod Posted March 25, 2008 Share Posted March 25, 2008 Hi all! Im having a mental problem here. Im building a web-service as my job right now, and it has a few "different pages", and as it USED to be in ALOT of files, I have compressed it into a few files. However, I have one main file, that has 1k lines of php and XHTML and there I will load all but two pages. The main page is built in a peculiar way ( or atleast for me, dont know how I got into doing it like that ). It creates pretty much all of the divs and tables that I use there, and then according to a $_GET['action'] it uses javascript to hide and show different divs. Any generic stuff, for example generating forms, it only does when the proper action is set. But even though I hide and show the layers in javascript, I still use PHP to get the proper action, so any link is an actual link, it will reload the page. There is approx 20 divs or so, that im hiding and closing according to the action, and the page is float based layout. Now, do you think this is a "not-good" way of creating a site? Do you consider, for example, including bit smaller files from an index file with php a better way? or just separate files without includes? ( separate files is not my type, at all ) Sorry if I were a bit confusing, hope to hear your thoughts! Later! Quote Link to comment https://forums.phpfreaks.com/topic/97796-an-obscure-way-of-building-a-site/ Share on other sites More sharing options...
sequalit Posted March 25, 2008 Share Posted March 25, 2008 you are loading alot of unnecessary data whenever someone goes to the page. the only way I can see that this would benefit you, is if your page is controlled with AJAX Otherwise, I would put everything in their own modules and include them, that way you only display what you need when you need it. Quote Link to comment https://forums.phpfreaks.com/topic/97796-an-obscure-way-of-building-a-site/#findComment-500653 Share on other sites More sharing options...
NikkiLoveGod Posted March 25, 2008 Author Share Posted March 25, 2008 Bah, I knew it I was hoping that someone would be on my side True that, It is loading alot of rubbish data, and I really dont know why I even started to build it that way. Maybe the horror of too many files was still haunting me And the alterations were actually quite small comparing to the main layout, so I guess that kinda drove me into it. Well, I know better next time Luckily, there arent ppl who know anything about the code in work Thanks for your reply! Quote Link to comment https://forums.phpfreaks.com/topic/97796-an-obscure-way-of-building-a-site/#findComment-500724 Share on other sites More sharing options...
sequalit Posted March 26, 2008 Share Posted March 26, 2008 if you implement AJAX... or some way of doing it so that you dont have to reload the page, then that woudl work great. Im just a noobie myself so good luck on figureing that one out (ive yet to tread into javascript/ajax its scary) Quote Link to comment https://forums.phpfreaks.com/topic/97796-an-obscure-way-of-building-a-site/#findComment-500881 Share on other sites More sharing options...
NikkiLoveGod Posted March 26, 2008 Author Share Posted March 26, 2008 Hah, I'm no better my self. I can handle php just fine and so on, but Im just recently starting to learn JavaScript. Yea, Ajax implemention would be awesome, but a bit too offshore for me. I just need to finish this one first, then I'll propably start learning it Quote Link to comment https://forums.phpfreaks.com/topic/97796-an-obscure-way-of-building-a-site/#findComment-501006 Share on other sites More sharing options...
Jenk Posted March 26, 2008 Share Posted March 26, 2008 you are loading alot of unnecessary data whenever someone goes to the page. the only way I can see that this would benefit you, is if your page is controlled with AJAX Otherwise, I would put everything in their own modules and include them, that way you only display what you need when you need it. AJAX has absolutely nothing to do with this topic. Quote Link to comment https://forums.phpfreaks.com/topic/97796-an-obscure-way-of-building-a-site/#findComment-501266 Share on other sites More sharing options...
sequalit Posted March 26, 2008 Share Posted March 26, 2008 you are loading alot of unnecessary data whenever someone goes to the page. the only way I can see that this would benefit you, is if your page is controlled with AJAX Otherwise, I would put everything in their own modules and include them, that way you only display what you need when you need it. AJAX has absolutely nothing to do with this topic. please explain why you say that? Got nothing better to do than sit around and point out everyone's mistakes instead of actually contributing? Quote Link to comment https://forums.phpfreaks.com/topic/97796-an-obscure-way-of-building-a-site/#findComment-501736 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.