Website being developed in PHP not CSS/HTML?

hi there,

I’ve currently contracted a design company to build some software and a website. The website has both public pages and then a log-in section. The log-in section is database driven and used SQL and PHP. I’m cool with that.

The problem I have, is that the company has also built the public pages using PHP which I find rather odd. The public pages do not interact with the back end. By building in PHP, it will make the process of me being able to update simple pages and designs extremely difficult.

Can anyone shed light as to why a site can’t have public pages in normal HTML/CSS and then backend (login) in other design PHP/SQL etc.

I asked the developer and they advised that it’s because the whole website is being built on the PHP framework.

Should I accept this answer? What are the pro’s and con’s?
Happy to share the link of the site under development if anyone wants me to PM them. Any help would be extremely well received

thanks

Anything you see in your browser must be built with HTML, CSS and perhaps JavaScript. So you are misunderstanding the basic setup here. PHP is processed on the server and sends HTML, CSS and JS to the browser. Unless the site is going to be completely static, it needs some kind of server-side code structure, which is most commonly built in PHP. If you want to be able to update the site yourself (through an interface of some kind) it will be built like this. As an example, WordPress sites are built with PHP. Of course, what you see in the browser is all HTML, CSS and JavaScript.

Just to expand on what Ralph said:

Even if it is completely static PHP can allow common pieces of the pages to be put in a separate file that is then included into all of the pages. Then when you want to change it there is one copy to change instead of needing to change it separately in each page. This can also be done using server side includes without PHP but using PHP then means that you can implement other server side code without needing to switch the language used for the server side processing.

thanks so much for your replies. maybe I should expand a little. The public pages are all static (brochure type website). only when someone signs up will they then need to interact with the site. I guess I’ve always been used to working with static sites acting like a skin. This is the first time I’ve ever delved into PHP and as the site does not have CMS, I’m just getting frustrated that I don’t have any control of public pages without having to know basic PHP editing.

We understood. But if you use a backend app to update the content, including those static pages, or if they use bits of code common to both static and non-static pages, PHP may be needed.

Without seeing the site itself (and with this, I mean the code and in this case the whole code, we don’t know if PHP is really necessary on those pages

Ah, sorry, I see more clearly what you are saying. It depends on how the framework does its thing, but it may not be too hard still to update pages. As felgall says, using PHP to construct templates can make things a lot more efficient, and you won’t necessarily need to know PHP to access the various parts of the site and make updates. It’s common for non-PHP folk (myself included) to wrangle WordPress files to suit one’s layouts, and WP templates are densely entwined with PHP.

Anyhow, as you say, there’s no reason why the public pages have to be built with the framework. But doing so will probably make the site structure more consistent overall (URLs and whatnot).

If you are more comfortable writing static HTML pages, you could always give the files the php extension even if they don’t use PHP. Not 100% efficient as they will get run through the PHP engine for nothing, but doable.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.