Your approach will work if you are not using Wordpress, but I would absolutely not recommend doing what you offer in the Wordpress Framework.
Instead of trying to reinvent the wheel, pretty much everything you want can be achieved with existing plugins. I would absolutely suggest using this route, especially if you do not have much experience programming Wordpress plugins.
Step 1:
Intuitive. I can’t do anything without it.
Step 2:
Installing
Type Plugin will give you a nice interface for registering your own
Custom Post Types and many other features to extend the basic features of Wordpress.
Step 3:
Here, everything starts to get complicated. Using types, register a custom message type called Event. The reason you want each event to be its own Mail is because each event is unique. Cities are designed to encapsulate and define groups of events, which leads us to the next step:
Step 4:
Think of taxonomy as a way to classify things. Wordpress comes with two default taxonomies: Categories (hierarchical) and tags (non-hierarchical). In your case, you will need to define a non-hierarchical taxonomy called "Cities" for your new type of event message.
Step 5:
Custom fields are the easy part. What determines your event? Maybe some fields that determine the start and end time of this particular event? Checkmark for free drinks? The sky is the limit. What defining characteristics will all the events that make this event have? Add those as custom fields. They will appear in your Event Editor as Meta Boxes. If you don’t see the “Meta-boxes” on the “Edit Page” page for a specific event, be sure to turn it on by clicking “Screen Settings” in the upper right corner of the screen and check the box in which your fields will be located.
Step 6:
Most of this can be done either through the types themselves (when setting up your custom taxonomy), or through .htaccess overwrites, or perhaps even through Permalinks Wordpress settings (although it is rather limited). My suggestion is to first set up custom taxonomy and permanent transfer settings before messing with .htaccess.
And this! I hope this should be enough for you to start everything you need.
source share