Wildcard Dns

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Wildcard Dns

    Ok, i thought i had it sorted out.
    But I'm having a little problem....

    I got my virual subdomains to work, thanx to sub that remembered me strugling with it on my current host.
    So now i got it working...
    But with my current host i strugled to get it working, but he helped me and we got it to wrok...

    Now my problem is, it doesn't want to redirect to the correct username (sites/index.php?name=$name)

    I did this code
    Code:
    <?
    include("config.php");
    $srvname=$_SERVER[&#39;SERVER_NAME&#39;];
    $srvname=strtolower($srvname);
    $query = "SELECT * FROM `users` WHERE `name` = &#39;".$srvname."&#39;";
    $result = mysql_query($query);
    $otvet = mysql_fetch_array($result);
    if($otvet[&#39;name&#39;])
    {
    header("location: sites/index.php?name=".$srvname."");
    }
    else
    {
    header("location: http://spiderwap.co.za");
    }
    ?>

    Click here!!!

    #2
    have you use wildcard on your own ?
    Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
    Visit: WapMasterz Coming Back Soon!
    _______
    SCRIPTS FOR SALE BY SUBZERO
    Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
    FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
    _______
    Info & Tips
    php.net
    w3schools.com

    Comment


      #3
      what?

      Click here!!!

      Comment


        #4
        what domain bro i mean own ?
        Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
        Visit: WapMasterz Coming Back Soon!
        _______
        SCRIPTS FOR SALE BY SUBZERO
        Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
        FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
        _______
        Info & Tips
        php.net
        w3schools.com

        Comment


          #5
          I&#39;m trying to run it on my 4wap.co.cc domain, but it&#39;s on same surver

          Click here!!!

          Comment


            #6
            if you have subdomains that exist really its easy to redirect it to the destined page

            here is a code to redirect

            [attachment=1690:fornoobs.txt]

            You&#39;d add this code to very top of your index page right after "<?php".
            Attached Files

            Comment


              #7
              Ok,,, so if i red the source right the code in my case should be.
              Code:
              <?php
              $domain = $_SERVER[&#39;HTTP_HOST&#39;]; 
              $domain_parts = explode(&#39;.&#39;,$domain); 
              if (count($domain_parts) == 3 && $domain_parts[0]!= "www") { // make sure a subdomain is called 
              $users=mysql_query(mysql_fetch_array("SELECT name FROM users WHERE name=&#39;".$domain_parts."&#39;"));
              $users[0] = $domain_parts[0]; 
              $loc = "http://4wap.co.cc/sites/index.pnp?name=$users[0]"; 
              @header("Location:$loc"); 
              }
              ?>

              Click here!!!

              Comment


                #8
                no i will be

                Code:
                <?php
                $domain = $_SERVER[&#39;HTTP_HOST&#39;]; 
                $domain_parts = explode(&#39;.&#39;,$domain); 
                include("config.php");
                if (count($domain_parts) == 3 && $domain_parts[0]!= "www") { // make sure a subdomain is called 
                $users=mysql_fetch_array(mysql_query("SELECT name FROM users WHERE name=&#39;".$domain_parts."&#39;"));
                $loc = "http://4wap.co.cc/sites/index.php?name=$users[0]"; 
                @header("Location:$loc"); 
                }
                ?>

                Comment


                  #9
                  or better
                  Code:
                  <?php
                  $domain = $_SERVER[&#39;HTTP_HOST&#39;]; 
                  $domain_parts = explode(&#39;.&#39;,$domain); 
                  include("config.php");
                  if (count($domain_parts) == 3 && $domain_parts[0]!= "www") { // make sure a subdomain is called 
                  $users=mysql_fetch_array(mysql_query("SELECT name FROM users WHERE name=&#39;".$domain_parts."&#39;"));
                  $loc = "http://4wap.co.cc/sites/index.php?name=$users[0]"; 
                  if($users[0]!= "")
                  {
                  @header("Location:$loc"); 
                  }
                  else
                  {
                  @header("location: http://spiderwap.co.za");
                  }
                  }
                  ?>

                  Comment


                    #10
                    Thanx, i&#39;ll try this one quick,,, if my ftp program just wants to connect grr @ace ftp

                    Click here!!!

                    Comment


                      #11
                      mmm, doesnt work m8

                      Click here!!!

                      Comment


                        #12
                        thats because co.cc domain will generate 4 exploded part in case of submdomain like username.domain.co.cc
                        so the code will be
                        Code:
                        <?php
                        $domain = $_SERVER[&#39;HTTP_HOST&#39;]; 
                        $domain_parts = explode(&#39;.&#39;,$domain); 
                        include("config.php");
                        if (count($domain_parts) == 4 && $domain_parts[0]!= "www") { // make sure a subdomain is called 
                        $users=mysql_fetch_array(mysql_query("SELECT name FROM users WHERE name=&#39;".$domain_parts."&#39;"));
                        $loc = "http://4wap.co.cc/sites/index.php?name=$users[0]"; 
                        if($users[0]!= "")
                        {
                        @header("Location:$loc"); 
                        }
                        else
                        {
                        @header("location: http://spiderwap.co.za");
                        }
                        }
                        ?>

                        Comment


                          #13
                          still having trouble

                          Click here!!!

                          Comment


                            #14
                            Nothing with the domain its how you code it
                            Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
                            Visit: WapMasterz Coming Back Soon!
                            _______
                            SCRIPTS FOR SALE BY SUBZERO
                            Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
                            FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
                            _______
                            Info & Tips
                            php.net
                            w3schools.com

                            Comment


                              #15
                              here is a fast line coding.


                              http://grim-reaper.grim-reaper.ws


                              Now i have subdomain for my members sites yeah i still see my url

                              Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
                              Visit: WapMasterz Coming Back Soon!
                              _______
                              SCRIPTS FOR SALE BY SUBZERO
                              Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
                              FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
                              _______
                              Info & Tips
                              php.net
                              w3schools.com

                              Comment

                              Working...
                              X