Jump to content

Recommended Posts

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 :D )

 

Sorry if I were a bit confusing, hope to hear your thoughts! Later!

Link to comment
https://forums.phpfreaks.com/topic/97796-an-obscure-way-of-building-a-site/
Share on other sites

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.

Bah, I knew it :) I was hoping that someone would be on my side :D 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 :D 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 :D

 

Thanks for your reply!

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 :)

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.

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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.