Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8658777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:50:59+00:00 2026-06-12T15:50:59+00:00

So I would have a template file called template.php and inside, it would have:

  • 0

So I would have a template file called template.php and inside, it would have:

<html>
some other content
<?php $name ?>
</html>

Essentially, I want to pull the name from the database and insert it into $name and save that entire page as a new file.

So let say in the database, I had a name called Joe, the new file I create would have the following content inside:

<html>
some other content
Joe
</html>

The only issue I am having is finding the right functions to actually replace the variable from the template file, and being able to save it into a new file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:51:00+00:00Added an answer on June 12, 2026 at 3:51 pm

    That’s not how templates usually work. You should have a template file, substitute variables for their values, and display it to the user. You can cache these generated templates (the ones that are always the same) but you never make a new template file for each user and save it permanently. That makes managing and updating the application way more difficult than you want.

    I recommend using a simple template system like RainTPL. That’s what I use for most of my projects… it’s very simple to use and provides all the basic functionality you would need.

    You can also use just PHP for this… there are a few answers on SO that cover this so I won’t get into it.

    • Using PHP as template engine
    • Using Template on PHP
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file template.txt which contains the following: Hello ${something} I would like
I'm building a HTML template for my site and would like to have a
I'm developing a web application with asp.net and I have a file called Template.docx
I have made a small xslt file to create an html output called weather.xsl
I have a conf file that is of the format: name=value What I want
1: I have a .html file that has some markup with some placeholder tags.
In specializing a class template, I would like to have one specialization target full-blown
I have 2 arrays that I would like to render in a template, one
How to write a template, that would take as argument classes, whose constructors have
I have a php file that uploads images like jpegs and png onto a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.