😕 I am a Newbie in PHP and I hope for help on this forum.

Thank you!

I know how to create and administer Flat File Databases and how to combine these with forms in PHP. What I don't know is how to get the data I need from these files and how to implement it in PHP for the dynamic creation of the respective content information.

PHP - Code

I want to create a admin form with which I can define all the variables and their respective values that I need on my various web sites. I thought that it

would be easiest to work with Flat File Databases which I would store on the same Hosting Account as the admin form.

My various web sites and their locations are organized as following:

Shared Webhosting Account 01 = SWA01
Shared Webhosting Account 02 = SWA02
Shared Webhosting Account 03 = SWA03
...

Website 01 = WS01
Website 02 = WS02
Website 03 = WS03
Website 04 = WS04
Website 05 = WS05
Website 06 = WS06
...

Webpage 01 = WP01
Webpage 02 = WP02
Webpage 03 = WP03
...

My Internet Sites are organized like this:

SWA01|
.....|WS01
..........|WP01
..........|WP02
..........|WP03
.....|WS02
..........|WP01
..........|WP02
..........|WP03

SWA02|
.....|WS03
..........|WP01
..........|WP02
..........|WP03
.....|WS04
..........|WP01
..........|WP02
..........|WP03
.....|WS01 (//the same website can be located on several Server Accounts//)
..........|WP01
..........|WP02
..........|WP03

etc.

On each of the web pages I use several URL links (Image and Text Links). The same URL link can be used on several web pages. And I want to use $VARIABLES

to include content parts that are also store centrally on the same hosting account as the admin form.

(x = number; y = variant of x)

DATAFILE-01: ID-xxxx | LINK-URL-VARIABLE-xxx-y | TITLE-VARIABLE-xxx-y | LINKTEXT-VARIABLE-xxx-y | TARGET-VARIABLE-x (//if empty = degfault = _blank//)

DATAFILE-02: ID-xxxx | IMG-URL-VARIABLE-xxx-y | STYLE-VARIABLE-x | ALT-VARIABLE-xxx-y

DATAFILE-03: ID-xxxx | DESCRIPTION-Variable-xxx-y | PRICE-VARIABLE-xxx-y | STRIKETHROUGHPRICE-VARIABLE-xxx-y | GUARANTEEDAYS-VARIABLE-xxx-y

Output in the following cases

Case-01
<a href="LINK-URL-VARIABLE-xxx-y" target="TARGET-VARIABLE-x" title="TITLE-VARIABLE-xxx-y">LINKTEXT-VARIABLE-xxx-y</a>

Case-02
<img src="IMG-URL-VARIABLE-xxx-y" style="STYLE-VARIABLE-x" alt="ALT-VARIABLE-xxx-y">

Case-03
include content stored in a VARIABLE such as DESCRIPTION-Variable-xxx-y

Thank you so much for your help and support in this matter! 🙂

    My first step would be to ditch the flat file and use a real database like MySQL.

      Bonesnap - Thank you!

      I can use MySQL too but still I have the problem of how to build the actual PHP connection to MySQL in order to build the correct code.

      Can you give me an example how I could build the code to the three cases I mentioned:

      Case-01
      <a href="LINK-URL-VARIABLE-xxx-y" target="TARGET-VARIABLE-x" title="TITLE-VARIABLE-xxx-y">LINKTEXT-VARIABLE-xxx-y</a>

      Case-02
      <img src="IMG-URL-VARIABLE-xxx-y" style="STYLE-VARIABLE-x" alt="ALT-VARIABLE-xxx-y">

      Case-03
      include content stored in a VARIABLE such as DESCRIPTION-Variable-xxx-y

      Thank you for your reply! 🙂

        Write a Reply...