Entrance Events! Chat Gallery Search Everyone Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining the forum??
June 06, 2025 - @724.02 (what is this?)
Activity rating: Three Stars Posts & Arts: 35/1k.beats Unread Topics | Unread Replies | My Stuff | Random Topic | Recent Posts Start New Topic  Submit Art
News: :skull: Websites are like whispers in the night  :skull: Super News: Upload a banner!

+  MelonLand Forum
|-+  World Wild Web
| |-+  ✁ ∙ Web Crafting
| | |-+  ☔︎ ∙ I need Help!
| | | |-+  is using php for my entire site bad practice? (tools to generate my site)


« previous next »
Pages: [1] Print
Author Topic: is using php for my entire site bad practice? (tools to generate my site)  (Read 480 times)
candycanearter07
Hero Member ⚓︎
*****


i like slimes

⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: candycanearter
Itch.io: My Games
RSS: RSS

View Profile WWWArt

Goomy, I Choose You!Suck At Something September - Did It!uh oh! a pigeon got in!Artsy Candy CaneJoined 2024!
« on: May 29, 2025 @757.86 »

So, with migrating to another website host, I was planning to NOT use a static site gen this time, since it felt like messy and stuff.. but there doesn't seem to be ANY other way to create a templating/shared code system... besides php include? but you obv need to use .php files for every page if you want to do that, so is there any kind of alternatives or is using php for every page a bad idea?
« Last Edit: May 30, 2025 @569.20 by Melooon » Logged

new to oldnet be nice




Melooon
Hero Member ⚓︎
*****


So many stars!

⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: melon
iMood: Melonking
Itch.io: My Games
RSS: RSS

View Profile WWWArt

Ozwomp wants to know your locationHyperactive DonutGreat Posts PacmanOfficially DogThanks for being rad!a puppy for your travels
« Reply #1 on: May 29, 2025 @771.41 »

Its not that its bad practice; but for a personal site it is unnecessary. Unless you are running a forum-like site; having dynamically generated pages is just a hassle after a while ~ you end up having to do extra code work, you have to maintain and update and learn PHP on top of HTML, and JS, and CSS, you have to worry about security vulnerabilities, the site runs slower and usually ends up costing more, and if you have a mistake in your code it can all crash.

A lot of that can be mitigated by having a web host handle the PHP installs for you (most will), but then your on the dynamic-host circuit and your site depends on hosts doing a good job and not over charging you. It also leads you into feature creep - once you have a PHP site, soon you'll find yourself needing a PHP & MySQL site and then you have another whole language to learn and manage.

Basically, unless you have a very good reason to get into PHP, what tends to happen is that its a fun-drain; it offers features that slowly suck the fun out of a personal site and its one of the big factors that lead to personal sites dropping out of popularity as people felt compelled to do PHP stuff.

As for you, you seem like someone who's prob gonna ignore all that and do PHP anyway, and I cant stop you  :tongue: However for most people reading, you are MUCH better off with a static site generator rather than a dynamic site.
« Last Edit: May 29, 2025 @774.70 by Melooon » Logged


everything lost will be recovered, when you drift into the arms of the undiscovered
candycanearter07
Hero Member ⚓︎
*****


i like slimes

⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: candycanearter
Itch.io: My Games
RSS: RSS

View Profile WWWArt

Goomy, I Choose You!Suck At Something September - Did It!uh oh! a pigeon got in!Artsy Candy CaneJoined 2024!
« Reply #2 on: May 29, 2025 @953.47 »

well but idk how to set up static site gen on the website itself and also like whats the best way to use a static site gen to not make it a complete disaster of workarounds
Logged

new to oldnet be nice




Melooon
Hero Member ⚓︎
*****


So many stars!

⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: melon
iMood: Melonking
Itch.io: My Games
RSS: RSS

View Profile WWWArt

Ozwomp wants to know your locationHyperactive DonutGreat Posts PacmanOfficially DogThanks for being rad!a puppy for your travels
« Reply #3 on: May 30, 2025 @960.02 »

well but idk how to set up static site gen on the website itself
You don't setup a static site gen on your web host, you generate the site on your computer then upload the generated site to your web host (that's what makes it static) ~ I cant offer much advice here because I don't know your skill level, what your trying to do or what your past issues have been (I also don't use static site gens or PHP on my personal sites); but there are a LOT of tutorials out there on this subject and well documented static site generators.

In general this forum is not really for supporting dynamic or static-generated sites ~ if you wanna go that rout there is plenty of info out there thats better than what you'll find here where most info is for hand-craft sites. So I recommend you research outside this forum for some best advice here ^^
Logged


everything lost will be recovered, when you drift into the arms of the undiscovered
arcus
Full Member ⚓︎
***


⛺︎ My Room
StatusCafe: arcus
Matrix: Chat!

View Profile WWW

Great Posts PacmanFirst 1000 Members!Joined 2023!
« Reply #4 on: May 30, 2025 @303.75 »

but there doesn't seem to be ANY other way to create a templating/shared code system...

What do code do you want to share specifically? Like Melon said, there's multiple tools out there to do that. If you're more specific I can post some.
Logged

candycanearter07
Hero Member ⚓︎
*****


i like slimes

⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: candycanearter
Itch.io: My Games
RSS: RSS

View Profile WWWArt

Goomy, I Choose You!Suck At Something September - Did It!uh oh! a pigeon got in!Artsy Candy CaneJoined 2024!
« Reply #5 on: May 30, 2025 @321.86 »

What do code do you want to share specifically? Like Melon said, there's multiple tools out there to do that. If you're more specific I can post some.

Just like layout stuff? And also having nested layouts too, like layout default referencing layout barebones.
Logged

new to oldnet be nice




xwindows
Jr. Member
**


⛺︎ My Room

View Profile

Great Posts PacmanJoined 2024!
« Reply #6 on: May 30, 2025 @448.82 »

As I normally hand-author my sites without any aid of templating, SSG, or CMS; take my advice with a grain of salt...

other way to create a templating/shared code system... besides php include? but you obv need to use .php files for every page if you want to do that, so is there any kind of alternatives
If you only want to include header code and footer code, there is also Server-Side Includes (SSI: those files with `.shtml` extension and weird-looking HTML comments) This stuff is done by the server itself; and is being a another primitive server-side technology which has been around since forever.

And also having nested layouts too, like layout default referencing layout barebones.
Yes, SSI does support nested include: by including other SHTML file. (Or even output from other CGI or PHP programs, which have their own include mechanism)

Just be aware that while parameter-passing between the including file and included file exist in SSI-- it does have limit. The variable you set on the main file would appear in the included subfiles, but you cannot call a subfile by using current file content as parameter. Thus your template in this scheme would have to be structured in sandwich-like fashion (1):

  • Header template content (included by main file)
  • Actual content (right in the main file)
  • Footer template content (included by main file)

When there are parent template and child template, an overall sandwich structure would be a bit more complicated like:

  • Child header template (included by main file)
    • Parent header content (included by child header template)
    • Child header content (inside child header template)
  • Actual content (right in the main file)
  • Child footer template (included by main file)
    • Child footer content (inside child header template)
    • Parent footer content (included by child footer template)

^ But in the actual main file, you only have to include the child header+footer template; and not the parent ones.

Since you're basically trying to find alternative to PHP `include()`; this SSI include operates within pretty much the same sandwich scheme and the same set of limitations as PHP include, so that should be no problem.

For a full reference documentation of SSI function in Apache WWW server, see its mod_include manual (which is more nerdy about this than the quick-start tutorial I linked above). Make sure to check that your server is Apache before you try though.



(1) As opposed to hotdog-like fashion (template that wraps over the content) commonly used in SSG templating scheme.
Logged
Melooon
Hero Member ⚓︎
*****


So many stars!

⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: melon
iMood: Melonking
Itch.io: My Games
RSS: RSS

View Profile WWWArt

Ozwomp wants to know your locationHyperactive DonutGreat Posts PacmanOfficially DogThanks for being rad!a puppy for your travels
« Reply #7 on: May 30, 2025 @566.25 »

Just like layout stuff? And also having nested layouts too, like layout default referencing layout barebones.
⚑ Moderators Note ⚑
This is a mod reply!
I think I have to step in here as a mod and say; I'm gonna lock this topic if all your responses are gonna be a single sentence. This is not enough info for people to work with.

For an issue like this we need:
  • Full descriptions of what your trying to do
  • Diagrams to support those descriptions if needed
  • Examples of other sites that do what you want
  • Details of the content or stuff you want on your site
  • Details of the parts of your site that need to be templated
  • A list of what tools you have worked with and what you have tried in the past
  • A list of what your comfortable with and enjoy using to make your site
  • Examples of the steps you have taken to solve this question before making this thread

~ if you're gonna ask for peoples assistance you have to first help them help you!
Logged


everything lost will be recovered, when you drift into the arms of the undiscovered
lime360
Full Member ⚓︎
***

hi.

⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: lime360
iMood: lime360
Matrix: Chat!
Itch.io: My Games

View Profile WWWArt

First 1000 Members!Joined 2022!
« Reply #8 on: May 30, 2025 @591.55 »

just like melon i also suggest using an SSG or writing plain HTML code

if you are planning on making an app that requires server-side code you can use a php framework like laravel or a different server-side language (i mostly recommend js+node or golang), writing plain php code without any security practices might lead your site to get completely bricked
Logged

Pages: [1] Print 
« previous next »
 

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021 | Privacy Notice | ~ Send Feedback ~ Forum Guide | Rules | RSS | WAP | Mobile


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi