Error in createing subdomain white use php script: how create subdomain on server

Discussion in 'PHP' started by mrjavad1, Apr 2, 2008.

?

how create sub domain in php code

  1. subdomain

    0 vote(s)
    0.0%
  2. php code

    0 vote(s)
    0.0%
  1. #1
    hi help me pleas!:
    below code has a error in running
    Error in createing subdomain white use php script:
    how create subdomain on server? why error happen?

    // SOURCE CODE IS
    $sub="$sub.$domain";
    $file = fopen ("http://$cpaneluser:$cpanelpass@$cpanelurl:2082/frontend/x3/subdomain/doadddomain.html?domain=$sub&rootdomain=$domain&dir=public_html%2F$domain&go=Create", "r");// line282
    if (!$file)
    {
    $ok = "1";
    $sub="";
    echo "error!";
    }

    while (!feof ($file))
    {
    $line = fgets ($file, 1024);// line 294
    }

    //ERROR IS
    Warning: fopen(http://...@www.sp724.com:2082/frontend/x3/subdomain/doadddomain.html?domain=nikiran&rootdomain=eline4u.com&dir=public_html%2Fnikiran&go=Create) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 401 Access Denied Still Working in /home/pw64/public_html/sitesaz/regt-2.php on line 282
    error!
    Warning: feof(): supplied argument is not a valid stream resource in /home/pw64/public_html/sitesaz/regt-2.php on line 294

    pleas help me to solving this problem
     
    mrjavad1, Apr 2, 2008 IP
  2. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #2
    try:
    file_get_contents("http://$cpaneluser:$cpanelpass@$cpanelurl:2082/frontend/x3/subdomain/doadddomain.html?domain=$sub&rootdomain=$domain&dir=public_html%2F$domain&go=Create");
    PHP:
    instead of your fopen();

    Jay
     
    jayshah, Apr 2, 2008 IP
  3. mrjavad1

    mrjavad1 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i am replace your code jayshah but not corecct!
     
    mrjavad1, Apr 3, 2008 IP