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

  • Home
  • SEARCH
  • 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 9123993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:28:17+00:00 2026-06-17T06:28:17+00:00

Is there a way to insert data from a WordPress custom field into a

  • 0

Is there a way to insert data from a WordPress custom field into a custom file instead of into the MySQL database?

The reason I want to do this is because I am trying to set up a custom field as a sort of PHP sandbox for the user and I would like to just use include filename.php in a template file and avoid inserting PHP data into the database and the security vulnerabilities that come along with this, or worse having to use eval after the data has been retrieved from the database.

I’m open to any other suggestions to accomplish this, but I think the easiest would be to store the data in a random php file and circumvent the database altogether.

  • 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-17T06:28:19+00:00Added an answer on June 17, 2026 at 6:28 am

    let me preface this by saying:

    this is a bad idea

    Your idea is to have end users upload PHP scripts that you will then execute on your server. Whats to stop an attacker from uploading a script like this:

    <?php
    // get a list of all of the wp-config.php files available to this user
    $configs = shell_exec("cd ~ && find `pwd` -name wp-config.php");
    // go through every match and email the contents 
    // of the file to my super secret hacker email or whatever
    // btw i now have mysql credentials for all of your wp sites.
    ?>
    

    And that isn’t even imaginative.

    that said here is how to do it

    Download and install https://github.com/fyaconiello/WP_Bad_Idea as a plugin on your WP site

    Then add this to your theme’s single-attack_post.php

    <h3>THE CODE</h3>
    <pre>
    <?php include($post->attack_code); ?>
    </pre>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to insert binary data into sql server directly from SQL
Is there a way to insert data from a table in schema1 to a
I insert data from a typed dataset into my MSSQL database by using SqlBuldCopy
I want to insert data from included file and create HTML-elements automatically. In data.php
I'd like to insert data into a mysql table using 'the cakephp way'. I
Is there any way to insert facebook like into pop image of fancybox?
Using SAS's Proc SQL, is there a way to insert records from a SAS
Is there a way that I can insert values into a VB.NET Dictionary when
I need to insert data from several tables with all the same field names
Is there any way to insert $_POST['textarea'] into <textarea> without escaping shell special chars?

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.