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 6188791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:17:46+00:00 2026-05-24T02:17:46+00:00

i have made an small script to allow users to build they page or

  • 0

i have made an small script to allow users to build they page or contact form in my site

but some friends told me they want add some JS scripts !

so i thinking about allow users to edit header.php file

the file content is – Example

<head>
<title>Mysite | user_name</title>
</head>

Now i have idea

i will take a copy from the real file ( header.php )

and allow user to edit it

the editable version will be

<title>{Mysite} | {user_name}</title>

and then , i will use ( str_replace function ) to replace {mysite} by my site title varibal

MY Question is !

if the user posted a php code

example

<head>
<title>{Mysite} | {user_name}</title>
<? include /// or echo 'error' or what ever ! ?>
//and some things others
</head>

the php code will work ? or will be ignored and used as html only ?

if there is a secure and good another way please tell me !

thank you

  • 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-05-24T02:17:47+00:00Added an answer on May 24, 2026 at 2:17 am

    If the header.php file, which your users can modify, is included (using require or include) from your PHP code, then, the PHP code it contains will be executed.

    In your case, I would rather :

    • Use a file name like header.tpl, to indicate that this file doesn’t contain PHP code, but is indeed some kind of template.
    • And I would not use inclure/require to get the content of that template file, but a simple file_get_contents().
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Post-release, I have made one small change to one form in our development site
I work with many small, but unrelated java projects. I made an Ant script
I have made small jquery collapse/expand script http://jsfiddle.net/goldie/QFL49/ (please don't pay attenton to html/css
I have just made a small little app of a Python wxPython script with
I have made a small log service that i want to publish to a
I have made a small application in Java and I would like to make
I have just started programming and have made a few small applications in C
I have made an update on Google App Engine with a small fix and
I have made some code which exports some details of a journal article to
I am working on a small bit of script that will allow for easy

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.