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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:24:03+00:00 2026-05-12T11:24:03+00:00

In my CMS I’ve added this code <div><?php include(my_contact_form.php) ?></div> which updates to a

  • 0

In my CMS I’ve added this code <div><?php include("my_contact_form.php") ?></div> which updates to a db. I can see it there OK.

I have this php code in my display page after the db call:

$content = $row['content']; 

when I echo $content inside the body this is displayed in the HTML source:

<div><?php include("my_contact_form.php") ?></div>

How could this possibly be? Why wouldn’t it show my contact form?
If anyone has any suggestions I would be extremely grateful.
Cheers.

  • 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-12T11:24:03+00:00Added an answer on May 12, 2026 at 11:24 am

    The simple solution is to run eval() on your content.

    $content = $row['content'];
    
    eval("?>".$content."<?php");
    

    The closing PHP tag and opening PHP tag allow you to embed HTML and PHP into the eval() statement.

    About the choice of storing your PHP and the DB vs Files.

    Assuming you’re goal is to have PHP that can be edited by admins from an interface, and executed by your server.

    You have two choices:

    Write the PHP to files, and include or exec() the files.
    Write the PHP to the DB, and exec() or cache the content to files and include().

    If you’re on a dedicated or VPS server, then writing to files is the best choice.
    However, if you’re on a shared hosting system, then writing to DB is actually the safer choice. However, this comes with the task that you must use a very safe system for querying the database, to eliminated all SQL injection possibility.

    The reason the DB is safer in a shared environment is due to the fact that you’ll need write access for the PHP process to the PHP files. Unfortunately, on “every” shared hosting setup, the same PHP user runs on each account and thus has write access to the same PHP files. So a malicious user just has to sign up for hosting and land on the same physical machine as you, or exploit a different account to gain access to yours.

    With saving the PHP in mysql, PHP cannot write to the mysql files since it doesn’t have the privileges. So you end up with more secure code, if you eliminate the possibility of SQL injection. Note that if you have an SQL injection vulnerability with write ability, then you have also opened a remote code execution vulnerability.


    Edit:

    Sorry the correct syntax is:

    eval("\r\n?>\r\n ".$php."\r\n<?php\r\n");
    

    Thats been tested quite intensively to work on every PHP configuration/setup.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 214k
  • Answers 214k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you don't echo or concatenate the <img> and add… May 12, 2026 at 10:51 pm
  • Editorial Team
    Editorial Team added an answer Both barkmadley and RC touch on it, but what you're… May 12, 2026 at 10:51 pm
  • Editorial Team
    Editorial Team added an answer From John Breakwell's Blog there are eleven possibilities: The thread… May 12, 2026 at 10:51 pm

Related Questions

In my CMS I've added this code <div><?php include(my_contact_form.php) ?></div> which updates to a
I'm wondering if there is an equivalent function to PHP's call_user_func() in ASP.NET application.
I have a 'template' system in my CMS rails app. Basically the whole HTML
I'm currently using the following code in my cms to check if visitor is
I'm using jQuery to build simple animations for a login form in my CMS.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.