FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


PHP that creates subdomain, ftp account, and mysql database?





Diablosblizz
I have NO clue if this is possible, but if you think about it..

A lot of free hosts (not including Frihost) have automatic signup. Somewhere, a FTP, subdomain, and mysql database HAS to be added when the user is finished signing up.

Does anybody know how to do this, or is this out of PHP?

Many thanks.
bladesage
Diablosblizz wrote:
I have NO clue if this is possible, but if you think about it..

A lot of free hosts (not including Frihost) have automatic signup. Somewhere, a FTP, subdomain, and mysql database HAS to be added when the user is finished signing up.

Does anybody know how to do this, or is this out of PHP?

Many thanks.


Well, there are several things to take into consideration.

First off, do you have root access, or are you just a user at the server in question? Most hosts don't grant privileges to create databases in MySQL to the users. If you have that kind of right, then creating new databases is a piece of cake.

Unless you have root access, I do not know of a single host that will let you alter the server config directly (as would be required in order to create subdomains). If you have root access, then creating subdomains is possible with PHP. On my personal testing server, I have a subdomain (admin.localhost) with a PHP script that is capable of listing, creating, and deleting subdomains automatically, but, to my knowledge, only works with my Windows XP and Apache combination.

As far as FTP goes, it varies from server to server. I don't know how to do it on any server at all, and I do not even mess with FTP.
lordstrife
Diablosblizz wrote:
I have NO clue if this is possible, but if you think about it..

A lot of free hosts (not including Frihost) have automatic signup. Somewhere, a FTP, subdomain, and mysql database HAS to be added when the user is finished signing up.

Does anybody know how to do this, or is this out of PHP?

Many thanks.


Don't know if this will help but you might be able to disect the code and see how they do it......

http://www.zubrag.com/scripts/cpanel-subdomains-creator.php
Dougie1
Well you could always just download some free hosting code.
Stubru Freak
PHP has shell access. See for example the system function (http://php.net/system). You should just invoke the necessary shell commands.
roeenoy228
PHP can't create subdomain, to create a subdomain/email address on your domain you should change some lines in your APACHE config.
Stubru Freak
roeenoy228 wrote:
PHP can't create subdomain, to create a subdomain/email address on your domain you should change some lines in your APACHE config.


PHP can do that, using exec or system.
Manofgames
@ bladesage: There are ways to do this without actually having root access.

CPanel has an API through which you can manage basic account functions such as create email address, create subdomain etc.

Direactadmin too has an API which allows you to interact with your account.
http://www.directadmin.com/api.html#user_apis
http://www.directadmin.com/forum/showthread.php?t=258
Alternatively, there is the option of using a php class to control your DA site:
http://www.phpclasses.org/browse/package/3399.html

@ Stubru Freak: That relies on you having access to the shell commands Wink

@ lordstrife: That will only work on CPanel because it relies on their own personal API

EDIT:
Diablosblizz wrote:

A lot of free hosts (not including Frihost) have automatic signup.

Frihost don't have a Visible implementation with Directadmin, ie you register and you get an account. This is because of the way Frihost operates though.
I'm pretty sure that the signup system could in theory have an option for accout creators to approve account requests from within the forum interface.

Hope this helps,

Alex
Related topics
[PhP] News Posting Tutorial (code, actually ^^')
Mysql database problem
PHPBB MYSQL Database Question.
Working with Excel, PHP & MySQL. Any Ideas
Mysql database size?
Knapmans Web Services
insert data to mySQL database problem
Free phpBB forum install [ended]
Delete data from MySQL database problem!!
Problem connecting to MySQL database with PHP [RESOLVED]
Need Help with mysql database of DragonflyCMS
How to search in a MySQL - database
Inserting PHP multidimensional arrays into a mySQL database
PHP Script for backing up MySQL
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.