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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:35:35+00:00 2026-05-20T01:35:35+00:00

I am writing a set of HTML based resources, stored in a mysql db

  • 0

I am writing a set of HTML based resources, stored in a mysql db on our server. The resources contain images references, which are stored as a relative paths.

I can login to an admin panel and create and edit resources very easily.

This bit is all done, and working well.

However, we are going to want to provide this resource in two ways: packaged and hosted. The one that is providing real problems is the hosted solution:

We want to host the database and all image resources, however we want to give access to the resources via a set of templates for other users to host on their own site. This is so they can brand the templates accordingly, and have the resource available at their own URL e.g.

http://www.example.com/discojoe

There are two questions I have on this process, which are causing me real headaches:

• I realise the obvious security implication of providing even read-only access to our mysql server. The only alternative I think of is some server side code running on our server, which when requested, squirts the requested data back to the user. This removes the need for them to have any mysql connection.

Are there any examples of the above type of scenario online I can read up on, or can you give some pointers on how I would go about addressing this solution?

• For users whom we stream the data to (if the above solution is sensible), how could I go about updating the image SRC value on the fly within the HTML content. Whilst I want it stored as a relative URL in the database, when I retrieve the data from the database, I want to convert all image srcs from relative to absolute, with the absolute URL that I specify.

  • 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-20T01:35:35+00:00Added an answer on May 20, 2026 at 1:35 am

    I realise the obvious security
    implication of providing even
    read-only access to our mysql server.
    The only alternative I think of is
    some server side code running on our
    server, which when requested, squirts
    the requested data back to the user.
    This removes the need for them to have
    any mysql connection.

    You could create an REST API(I would return JSON) using predefined queries with PDO prepared statements(safe against SQL-injections). With a little bit of care you could make it pretty safe. Ofcourse if the resources should be protected, you must also add authentication to your system using simple API keys for example. I think you could generate these key easily the same way you prevent CSRF($token = md5(uniqid(rand(), TRUE));). Maybe you should add a little bit more entropy, but I think this is going to be sufficient. But if you want to really do it correctly you should use oauth instead.


    with a little bit of mod_rewriting you could write pretty URLs.

    For users whom we stream the data to
    (if the above solution is sensible),
    how could I go about updating the
    image SRC value on the fly within the
    HTML content. Whilst I want it stored
    as a relative URL in the database,
    when I retrieve the data from the
    database, I want to convert all image
    srcs from relative to absolute, with
    the absolute URL that I specify.

    I think you could use any of the many available template languages to achieve this. Even jquery has one built-in

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

Sidebar

Related Questions

Can you set the Z-Index for an image in HTML without writing or embedding
I'm writing a set of functions in c++ which can be called by excel.
I am writing a library which is a set of classes meant to be
First let me set the situation. I am writing a simple client html page
I am writing a simple HTML code which uses YUI autocomplete (to display suggestion
For a Rich Text (RTF) to HTML / XHTML converter I am writing, which
I am writing a gem which provides helpers for views. The HTML I want
I'm writing code to display html content in Qwebview, i did it by setHtml
I am writing a set of classes that handle simple file uploads with both
Possible Duplicate: C++ alignment when printing cout << I am writing a set of

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.