To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > PHP Help > Coding

Coding Help with PHP coding

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-07-2007, 04:12 AM   #1
niroshan
Senior Member
 
niroshan's Avatar
 
Join Date: Nov 2002
Location: sri lanka
Posts: 208
park domains using PHP

Hi everyone,

I need to find out a way to park domains using PHP. I can park domains using my cpanel but what i needed to do is to create a script using PHP which will do that automatically. Only thing i accept from user is the domain name they want to park and thats it. the rest i want to handle through my program.

I have done some research and found out that all the park domain entries goto one file (httpd.conf)

My first question is can i do this using php? Is there any other way instead of writing the httpd.conf file? I dont want to mess with httpd.conf file since it contains all the configurations


If someone can point me to right direction i`ll be really appreciate it.

Thanks in advance,

Regards,
Niroshan
__________________
Be the best you can be!!!!!
niroshan is offline   Reply With Quote
Old 08-07-2007, 08:01 AM   #2
cahva
Senior Member
 
cahva's Avatar
 
Join Date: Jul 2002
Location: Finland
Posts: 1,325
You dont have to add the domains to httpd.conf file. When you set dns to point to the server, Apache will direct the page to server's default page if the domain is not added to the httpd.conf.

You can use PHP to show what domain is parked. Modify the servers default page using this little script:

PHP Code:
<?php
if (!empty($_SERVER['HTTP_REFERER'])) {
        
$refe = $_SERVER['HTTP_REFERER'];
} else {
        
$refe = $_SERVER["HTTP_HOST"];
}

echo
"Domain {$refe} is parked here.";
?>
Not the most sophisticated one but will do the job.

Oh, you dont have to use the servers default page if you dont want to. Add IP to httpd.conf that will handle all the domainpark domains and then when you add DNS to some domainpark domain, point it to that ip.
cahva is offline   Reply With Quote
Old 08-07-2007, 08:10 AM   #3
niroshan
Senior Member
 
niroshan's Avatar
 
Join Date: Nov 2002
Location: sri lanka
Posts: 208
Hi cahva,

Thank you very much for your valuable reply. Really appreciate it. I have one other question,

If i didn`t edit the 'httpd.conf' file to add the park domains what will be the result when i`m checking everthing next time from cpanel.

Im not sure but i think cpanel reading this file and show us the list of parked domains right?

if this is the case is there any work around for this?

thank,
Niroshan
__________________
Be the best you can be!!!!!
niroshan is offline   Reply With Quote
Old 08-07-2007, 09:13 AM   #4
cahva
Senior Member
 
cahva's Avatar
 
Join Date: Jul 2002
Location: Finland
Posts: 1,325
I havent used cpanel so I dont know how that works, sorry
cahva is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 09:41 AM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.