How to organise a php based website - subdomain

I am putting my php /mysql website up and this is my scenario
The users are grouped into sites each site with their own unique database.
There will be about 40 users per site.
the two options I'm trying to decide between are
have a central website running the php and directing the users off to their own database
using sub domains for each user each with their own php in htdocs
I dont even know if 2 is possible/stupid but if it was, would it make any difference to performance as they're all being run by the same server. Any other ideas/ advice much appreciated as I want to organise it the best way from the start

At login, you won't know where to direct them as they haven't identified themselves yet. After login, you can easily customise it for them.
You could create two separate PHP login files, and give different links to each set of users, but a simple clean login page and then a customised front end after login seems the best way.

1 would definitely be the right idea, you only have one copy of the code to worry about and you don't waste disk space on extra copies of the same code.

You could use 1 with wildcard subdomains and use .htaccess to change the subdomain into a posted parameter. That way you get one copy of the script and subdomains all in one go.
One thought, why dont you use a single database with an extra 'accounts' table, this may simplify things!

Related

PHP script for front-end management of MySql tables

I'm looking for a PHP script that will allow me to easily manage 'MySql' tables. By managing I mean not their creation but the possibility of adding new records, modifying and deleting them.
It must be possible to specify for each user which tables he will have access to and with which modalities (insertion only, modification only, etc.).
For each user I will also have to specify whether he will be able to see all or some of the columns in the table and with which permissions.
Also I'll need to know who did what, a sort of global change LOG.
My idea was to have a back-end in which I specified the users and how to access the various tables/columns and a front-end for the users.
In the front-end users will be able to add/modify/delete records and data they are allowed and the ability to filter and/or sort the various records.
I know I could use some PHP frameworks or rely on CMS but I have to write a lot of code by hand and it seems hardly credible that such a product is not already available.
Does anyone know if there is something like this?
I had tried starting with PHP frameworks but implementing everything from scratch stopped me.
I expect there is already something available.
Thanks.
Davide.

How do classified sites use sub domains and make them work like a single Application?

I would like to create a classified ads site like craigslist and I want to use sub domains for each city, like craigslist does.
I’m wondering if anyone knows how they spread their site out on so many subdomains and still make it work like one big site and not hundreds of little ones.
Make sense? Any idea of a classified ads script that can do that?
Think Wordpress can do that?
Thanks in advance for your reply.
It's all about DNS. It can be done with a wildcard entry (*.craigslist.com) that points to a single website that decides the content to display based on the subdomain. The same thing can be done with a single A record for each subdomain in use. Which is probably what they do or else all requests to craigslist.com would go to the single IP--even the unsupported ones.
I find the best way to do it is to have a single A record for the server IP with a host name like "myserver.mydomain.com" and then add CNAME records for each subdomain redirecting to the "myserver" subdomain. This makes it so you don't have to change all the subdomain IP addresses if you move your server.
In any case, your server looks at the subdomain in the host header to determine the content to display.
Hope that helps.

Editing Access forms while other people are using

Is there any workaround people are aware of to edit Access forms while the database is in use by someone else on the network?
Solved(?): Think I figured this out. I guess I didn't fully understand how a split database worked yet. I'm going to split the database, hide the backend in my own folder. The front end will be on the share drive for anyone to use. I can make as many copies of the front end as I want, as they'll all be linked to the tables in the backend location. I can edit the structure of the front end whenver I want and just replace the one in the share drive for people to access.
You are going to want to create a split end database. That way you can work on your copy while others are still able to use the database. You can find information about it in the following link: https://support.office.com/en-gb/article/Split-an-Access-database-3015ad18-a3a1-4e9c-a7f3-51b1d73498cc
If you already have a split database than simply just work on your own master copy and send out the updated version to whomever will be using it.

Add joint primary key to wordpress posts table

I am working out how to synchronize wordpress installations where both can be updated simultaneously, and both can work offline, then come online to sync.
I think the easiest way to sync posts between sites, is to include the site id in the primary key of the posts. Therefore, any post is identified by an incremental id and the id of the server location it was created from.
Is this possible to achieve with a plugin?
What dangers lie ahead if I pursue this path?
Is there a better, alternative way to achieve what I am trying to achieve?
It is possible in several ways:
- Write a stored procedure inside the first Wordpress installation's php files, that inserts the content into the other database when something is written to it. This one probably won't work offline.
- Write a function that compares the two databases at a schedule time using a simple sql query and creates a diff log. Then copies over the difference to the other database.
It depends why you need to do this, but if this works, I would recommend this solution:
- Keep one wordpress installation. Maintain one database, and connect to it from the other website to load the content. You can create your own SQL connection to it and load whatever content you need.
- Keep one wordpress installation, and use it's RSS feed to read the content and display it in whichever second website you need to do it in.
I can't imagine how a plugin would be of much help, especially keeping the databases in sync offline too. In my experience, its usually better to write your custom php scripts, rather than use a plugin so you can have a more direct control over the functionality.
Hope this helps.

How can I get my content from a Joomla blog into Blogger or Wordpress?

I have an old joomla site (v 1.0.11) that I would really like to move over to Blogger or Wordpress. The commenting on the site uses AkoComment which was an add on module. Basically, I want to transfer:
posts
comments
users
css
I haven't found a good tool out there to do this. What tools would be best to begin to work with this data? The joomla database is MySql. I would prefer to use blogger as you don't have to pay to host sites on it. That means though that I don't have direct access to the database. Blogger takes Atom feeds as import. The default Atom feed on Joomla will only list the last five posts though, not all, and won't include comments.
Any help here would be appreciated!
There's no easy way. All your user data in particular will be impossible to migrate due to the completely different ways the two systems would handle passwords and so on.
For the posts though, you probably can migrate them. You'll have to study the format of each platform's database tables and create a query or two to migrate data. For example, something like the below would work. Most of the variables listed here are not the actual ones, you'll need to replace them with whatever's appropriate. The 1 is whatever your ID is in the new system.
INSERT INTO wordpress_db.wp_posts ( `wp_author`, `wp_post`, `wp_date` )
SELECT 1, `content`, `posted` FROM joomla_db.jos_content
Write an HTTP bot to submit the data from your database or build a megafeed with all your Joombla blog entries. I personally enjoy coding this kind of scripts.