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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:41:27+00:00 2026-06-15T23:41:27+00:00

I have some content coming from database. And I want to replace the specific

  • 0

I have some content coming from database. And I want to replace the specific word of the content with a bunch of code.

Content coming from database is for example:

Thank you for interest on our web site.
{FORMINSERT}
You can
also contact us by calling us to 1234567890

I want to replace the string {FORMINSERT} with a bunch of PHP code. If it is a normal text string I can simply replace it by using str_replace.

But the replacing content is not simple text it is form code.

want to replace this {FORMINSERT}

with example:

<form method="post" id="form1" action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>">
    <table cellpadding="5" cellspacing="2" >
        <tr>
            <td width="84" ><a name="contact" id="contact"></a></td>
            <td width="384">&nbsp;</td>
        </tr>
        <tr>
            <td colspan="2" ><h1>Contact Us</h1></td>
        </tr>
        <tr>
            <td ><label for="fullname">Name:</label></td>
            <td>
                <input type="text" name="fullname" id="fullname" value="<?php echo KT_escapeAttribute($row_rsscotts_contact['fullname']); ?>" size="47" />
                <?php echo $tNGs->displayFieldHint("fullname");?> <?php echo $tNGs->displayFieldError("scotts_contact", "fullname"); ?>
            </td>
        </tr>
        <tr>
            <td ><label for="phone">Phone:</label></td>
            <td>
                <input type="text" name="phone" id="phone" value="<?php echo KT_escapeAttribute($row_rsscotts_contact['phone']); ?>" size="47" />
                <?php echo $tNGs->displayFieldHint("phone");?> <?php echo $tNGs->displayFieldError("scotts_contact", "phone"); ?>
            </td>
        </tr>
        <tr>
            <td><label for="email">Email:</label></td>
            <td>
                <input type="text" name="email" id="email" value="<?php echo KT_escapeAttribute($row_rsscotts_contact['email']); ?>" size="47" />
                <?php //echo $tNGs->displayFieldHint("email");?> <?php echo $tNGs->displayFieldError("scotts_contact", "email"); ?>
            </td>
        </tr>
        <tr>
            <td><label for="tellus">Looking for:</label></td>
            <td>
                <textarea name="tellus" id="tellus" cols="37" rows="5"><?php echo KT_escapeAttribute($row_rsscotts_contact['tellus']); ?></textarea>
                <?php echo $tNGs->displayFieldHint("tellus");?> <?php echo $tNGs->displayFieldError("scotts_contact", "tellus"); ?>
            </td>
        </tr>
        <tr>
            <td></td>
            <td>
                <input type="submit" name="KT_Insert1" id="KT_Insert1" value="Submit" class="button-blue" /> 
                <input name="Reset" type="reset" value="Reset" class="button-grey" />
            </td>
        </tr>
    </table>
</form>
  • 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-15T23:41:28+00:00Added an answer on June 15, 2026 at 11:41 pm

    test1.php:

    $database_content = 'Thank you for interest on our web site.
    {FORMINSERT}
    You can also contact us by calling us to 1234567890';
    
    if(stripos($database_content, '{FORMINSERT}') !== FALSE){
        ob_start();
        include 'test2.php';
        $result = ob_get_clean();
    }
    
    $database_content = str_replace("{FORMINSERT}", $result, $database_content);
    
    echo $database_content;
    

    test2.php (the code you’re trying to insert in):

    echo 'hello world';
    

    The result:

    Thank you for interest on our web site. hello world You can also
    contact us by calling us to 1234567890

    So it is as if the code “echo ‘hello world’;” was sitting right where {FORMINSERT} was. You can just create a bunch of PHP files to include like that, and make some if statements to handle the replacements.

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

Sidebar

Related Questions

I have a particular scenario in my application where some content (coming from service)
I have some text coming in from a textarea and want to preserve the
I have Excel file and some contents, coming from external source(database, file, whatever). I've
I have some content that I want to appear on multiple pages of my
I have some content I want to show in iframe with fancybox. When I
I have some data Foo that I want to pass from the browser to
Hi all.. I want to get some information from my database and show into
I have some content set to be in 3 columns, but as it wraps
I have some content sliding here. http://www.smallsharptools.com/downloads/jQuery/Slider/slider.html The HTML structure is simple. There is
I have some content that I am loading using jquery ajax. The content has

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.