Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Can you create sub-domains in PHP?
Old 12-08-2005, 03:24 AM Can you create sub-domains in PHP?
Ickie's Avatar
Extreme Talker

Posts: 217
Location: Australia
Trades: 0
Are you able to create subdomain though PHP? I have cPanel, I heard you can work with that to create them?

Any ideas? My plan was to give every who signed up a free subdomain since I have unlimited .
Ickie is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-08-2005, 08:01 AM
Ultra Talker

Posts: 251
Location: Belgium, Antwerp, Zoersel
Trades: 0
You can't do it through php, but you should be able to do it with cPanel, manually.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Orodreth is offline
Reply With Quote
View Public Profile Visit Orodreth's homepage!
 
Old 12-08-2005, 08:44 AM
Ickie's Avatar
Extreme Talker

Posts: 217
Location: Australia
Trades: 0
I was thinking of doing it automaticly like when the user puts in his/hers name.
Ickie is offline
Reply With Quote
View Public Profile
 
Old 12-08-2005, 09:08 AM
Skilled Talker

Posts: 62
Trades: 0
You may end up needing to use cURL to post/get form info after logging in with your cPanel password within the PHP script - i.e.

http://myusername:mypassword@www.mys...getopostto.php

Look at the cPanel code, the forms and get parameters - then use cURL to post away to your heart's content. Subdomain creation shouldn't be too hairy.
__________________

Please login or register to view this content. Registration is FREE
danlefree is offline
Reply With Quote
View Public Profile Visit danlefree's homepage!
 
Old 12-08-2005, 09:10 AM
Ickie's Avatar
Extreme Talker

Posts: 217
Location: Australia
Trades: 0
Is that secure, couldn't people read that?
Ickie is offline
Reply With Quote
View Public Profile
 
Old 12-08-2005, 10:39 AM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
Is the server your own? If so you could just modify the DNS files with PHP although you will have to be very secure otherwise people may gain access to it.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 12-08-2005, 10:36 PM
Ickie's Avatar
Extreme Talker

Posts: 217
Location: Australia
Trades: 0
No I don't, I have shared hosting with asmallorange.

Would their be someway I could encrypt that URL? It seems like the only way it can be done.
Ickie is offline
Reply With Quote
View Public Profile
 
Old 12-08-2005, 10:40 PM
HaRRo's Avatar
SEO Expert

Latest Blog Post:
The Large Hadron Collider
Posts: 522
Location: United Kingdom
Trades: 0
You could use mod rewrite :P forwarding sub.domain.com to domain.com/sub/

?
__________________

Please login or register to view this content. Registration is FREE

What are you waiting for? Easy $$$ anyone can make a fortune!
CLICK CLICK CLICK CLICK CLICK CLICK CLICK CLICK CLICK
HaRRo is offline
Reply With Quote
View Public Profile Visit HaRRo's homepage!
 
Old 12-09-2005, 12:07 AM
Ickie's Avatar
Extreme Talker

Posts: 217
Location: Australia
Trades: 0
Is that even possible? The cPanel is on another host, I can't change that can I? If I can how? I'm not really good at .htaccess.

I found a script http://docs.ciscofreak.com/ap/php/pu...astsubdomains/ but it doesn't seem to work.

Last edited by Ickie; 12-09-2005 at 01:16 AM..
Ickie is offline
Reply With Quote
View Public Profile
 
Old 12-09-2005, 01:24 AM
Skilled Talker

Posts: 62
Trades: 0
A background cURL post would be invisible to your visitors.
__________________

Please login or register to view this content. Registration is FREE
danlefree is offline
Reply With Quote
View Public Profile Visit danlefree's homepage!
 
Old 12-09-2005, 01:31 AM
Ickie's Avatar
Extreme Talker

Posts: 217
Location: Australia
Trades: 0
Sorry but what is cURL.. I tried googling it and got nothing.
Ickie is offline
Reply With Quote
View Public Profile
 
Old 12-10-2005, 04:09 AM
Skilled Talker

Posts: 62
Trades: 0
With a US Google search, the first result is:

http://curl.haxx.se/
__________________

Please login or register to view this content. Registration is FREE
danlefree is offline
Reply With Quote
View Public Profile Visit danlefree's homepage!
 
Old 12-12-2005, 08:11 PM
Novice Talker

Posts: 5
Trades: 0
Actually yes you can, you need to use mod-rewrite to do this.

The only problem with mod-rewrite is it will eat up some resources off your server if you have a lot of members on your free hosting service.

It's still worth it give it a shot.
nwelsh is offline
Reply With Quote
View Public Profile
 
Old 12-12-2005, 08:47 PM
RideConnection's Avatar
Super Talker

Posts: 132
Trades: 0
Yea mod-rewrite would work, just enable wild cards and you're set.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
RideConnection is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Can you create sub-domains in PHP?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.67221 seconds with 12 queries