change name of parked domain

Discussion in 'PHP' started by Gursimran, Oct 10, 2007.

  1. #1
    Hey guys. I need a little help in php. my main proxy is pa4.info and 18 other domains are parked on same account. i am using a single file for all which is on the root folder and to change the title on of every domain i am using this code on the top of index.php
    $pageUR1 = str_replace("/", "", $_SERVER["SERVER_NAME"]);
    $pageURL2 = str_replace("www.", "", $pageUR1);
    $pageURL = ucfirst($pageURL2);
    PHP:
    and where there is a need of page title i am using this
    <?php echo $pageURL; ?>
    PHP:
    it should work but it is not working
    see www.pa4.info . it is the main domain and www.pz4.info. it is parked and the name should change but not changing.
    plz help me out. My php version is 4.4.7. I am sure my code is correct
    regards...
     
    Gursimran, Oct 10, 2007 IP
  2. mikemotorcade

    mikemotorcade Peon

    Messages:
    645
    Likes Received:
    49
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try echoing $_SERVER["SERVER_NAME"] to make sure the value is correct. Is the code in one file that all of the other sites reference? If so, I believe that variable would be the same for every site. I could be wrong. But, in order to troubleshoot it, start with just this:

    echo $_SERVER["SERVER_NAME"];
    PHP:
    See if it even will do that. (On the page you want to display the name on. Don't use a separate file until later.) Then one by one ad in the other lines to see where you error is (and btw, you don't have to use different variables for $pageURL):

    $pageURL = str_replace("/", "", $_SERVER["SERVER_NAME"]);
    echo $pageURL;
    PHP:
    $pageURL = str_replace("/", "", $_SERVER["SERVER_NAME"]);
    $pageURL = str_replace("www.", "", $pageURL);
    echo $pageURL;
    PHP:
    $pageURL = str_replace("/", "", $_SERVER["SERVER_NAME"]);
    $pageURL = str_replace("www.", "", $pageURL);
    $pageURL = ucfirst($pageURL);
    echo $pageURL;
    PHP:
    Start with that, and if you discover exactly where it is failing, that should tell you what is wrong. If you do make it through all that, try posting here again.
     
    mikemotorcade, Oct 10, 2007 IP