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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:01:40+00:00 2026-05-25T16:01:40+00:00

I managed to create a simple blog and an admin page using PHP. I

  • 0

I managed to create a simple blog and an admin page using PHP. I didn’t use a CMS like wordpress because I wanted a deeper understanding of PHP.

I wanted to create an admin page that allowed the user to specify where in their blog posting they could put in a picture; for example, they can add a photo before the first paragraph or after.

My admin page as it is now is just a textarea input field and a submit button that submits text-only blog posts from the textarea field to the database. My thought process was that I could add img tags into the textarea input field, but the user’s photos might be stored on their hard drive so I thought of the idea to store PHP code in the textarea input field to retrieve image files from the database. For example, if I wanted to place a photo after the first paragraph of the blog post, I would type something like this into the textarea field:

This is the first paragraph. Here is a photo of my vacation:
<? echo "<img src='getPhoto.php?page=blogPost'>"; ?>

Then I click the “submit button” and the paragraph with the PHP code gets submitted into my database. The page with the blog posting retrieves the text, “This is the first paragraph. Here is a photo of my vacation:” and the PHP code. The PHP code then retrieves and shows the photo.

The problem is that submitting PHP code with the blog text might be confusing for a user who is not tech-savvy or does not have any programming knowledge. The admin page should make it possible for the blog writer to place photos anywhere in their blog post without programming knowledge. I haven’t found a tutorial yet that covers image placement in a PHP blog’s admin page. Any help getting started would be appreciated.

  • 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-25T16:01:41+00:00Added an answer on May 25, 2026 at 4:01 pm

    One way to accomplish what you want is by implementing custom shortcodes. In you case it’d look something like this:

    This is the first paragraph. Here is a photo of my vacation:
    
    [image bahamas-00123]
    

    How it works is that you do something like this:

    $text = shortcodes($text);
    

    You’d need a separate area for uploading photos and some way of keeping track of them (ie: sql, flatfiles) so you know that bahamas-00123 actually refers to /some/path/DSC-00123.JPG.

    For some code please check the accepted answer of: How do I replace custom “tags” in a string?

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

Sidebar

Related Questions

I have been trying to create a simple calculator. Using PHP I managed to
I've been using the Semaphore class to create semaphores. However, the examples use managed
I managed to create a class using CodeDom and add a single method to
I have managed to create a custom action in C# using MakeSfxCA which is
I've deconstructed a standard WPF button using Blend and have managed to create a
I want to create a simple PHP website containing quite a number of pages.
Managed to create a simple bootloader... and with VESA 2.0 I managed to change
I managed to get a set of images loaded using Python. I'd like my
I've managed to create a simple rounded rect button in Xcode through code but
I created a simple HtmlInputText <h:inputText binding=#{IndexBean.objUIInput} /> Then in my managed bean, it

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.