Gossamer Forum
Home : General : Perl Programming :

Automating Signup

Quote Reply
Automating Signup
Hi,
I'm trying to write a cgi script which will create a subdomain under my domain. The subdomain must have a ftp account. I'm using a co-location server with RedHat Linux 6.0.


Thanks for your time
Neil

------------------
--
n: Neil Skirrow and Wave Developments
e: Webmaster@skirrow.com
w: http://www.skirrow.com
t: +44 (0)1394 383128
Quote Reply
Re: Automating Signup In reply to
Code:
#!/usr/bin/perl

# TrueVirtual version 2.0
# (c) 1998 HarveyOpolis
# All Rights Reserved
# Latest version available at http://www.harveyopolis.com/cgi
# Usage of this script is free, but a link to http://www.harveyopolis.com would be appreciated.
# DO NOT DISTRIBUTE THIS SCRIPT!
# REMEMBER TO UPLOAD IN ASCII MODE

# Please enter the title of your own site (similar to the <TITLE> tag)
$title = "Title of Your Own Site";
# What is the URL to your own site?
$url = "http://www.host.com/home.html";

# STOP! NO FURTHER EDITING IS NECESSARRY.
##########################################################################


$name = $ENV{'HTTP_HOST'};
$browser = $ENV{'HTTP_USER_AGENT'};
$match = "no";

open (FILE, 'database');
@database = <FILE>;
close (FILE);

print "Content-type: text/html\n\n";

foreach $line (@database) {
@dataline = split(/\|/,$line);

if ($name =~ /$dataline[0]/)
{
$match = "yes";

print "<HTML><HEAD><TITLE>$dataline[2]</TITLE></HEAD>\n";
print "<FRAMESET ROWS=\"100%,*\" FRAMESPACING=0 FRAMEBORDER=0 BORDER=0>\n";
print "<FRAME SRC=\"$dataline[1]\" NAME=MAIN SCROLLING=\"AUTO\" NORESIZE FRAMEBORDER=0 BORDER=0 MARGINHEIGHT=3 MARGINWIDTH=3>\n";
print "</FRAMESET></HTML>\n\n";
}
}


if ($match eq "no")
{
print "<HTML><HEAD><TITLE>$title</TITLE></HEAD>\n";
print "<FRAMESET ROWS=\"100%,*\" FRAMESPACING=0 FRAMEBORDER=0 BORDER=0>\n";
print "<FRAME SRC=\"$url\" NAME=MAIN SCROLLING=\"AUTO\" NORESIZE FRAMEBORDER=0 BORDER=0 MARGINHEIGHT=3 MARGINWIDTH=3>\n";
print "</FRAMESET></HTML>\n\n";
}

I know, it says Do not distribute, but what the hell Smile I never got this thing working anyway. You probaly want to download newer version, if there's any.

Regards,

Pasha

------------------
webmaster@find.virtualave.net
http://find.virtualave.net
Quote Reply
Re: Automating Signup In reply to
Hi,
Thanks, but that isn't really what I want!

I need a script which will CREATE subdomains with FTP accounts!!! On a RedHat Linux 6.0 Server. That only creates virtual subdomains. Which is use less to me!

Thanks anyway.
Neil

------------------
--
n: Neil Skirrow and Wave Developments
e: Webmaster@skirrow.com
w: http://www.skirrow.com
t: +44 (0)1394 383128