Quick PHP question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Buzz_11
    Confirmed User
    • Sep 2002
    • 214

    #1

    Quick PHP question

    Got a quick (stupid) question for any PHP gurus out there....

    How can I tell php to go from something like this:

    /home/httpd/html/somedomain.com/public_html

    to something like this:

    http://www.somedomain.com

    Yes I'm new.... stop laughing...........


    STOP IT!!

    But seriously -- any help would be appreciated....

    Thx in advance

    Buzz
  • kevinale
    Confirmed User
    • Dec 2002
    • 2115

    #2
    huh?

    i dont understand. . .
    1monkey0cup.com

    Comment

    • Buzz_11
      Confirmed User
      • Sep 2002
      • 214

      #3
      I have this path in PHP:

      /home/httpd/html/somedomain.com/public_html


      and I want to display it on a page as this:

      http://www.somedomain.com
      (as a link)

      Comment

      • inthestars
        Registered User
        • Sep 2002
        • 2021

        #4
        What do you mean?

        Do you want it to forward?

        <?php

        header (location: $url_you_want_here ");

        exit;

        ?>

        Comment

        • whee
          Confirmed User
          • Sep 2002
          • 1375

          #5
          Something like this?

          $q="/home/httpd/html/somedomain.com/public_html";
          $z=explode("/", $q);
          $t1=$z[0]; $t2=$z[1]; ... etc

          http://www.nightstation.com

          Comment

          • vending_machine
            Confirmed User
            • Jun 2002
            • 1070

            #6
            &lt;?PHP

            $path="/home/httpd/html/somedomain.com/public_html";
            print( preg_replace( ".*", "http://www.somedomain.com", $path ) );

            ?&gt;

            Comment

            • Buzz_11
              Confirmed User
              • Sep 2002
              • 214

              #7
              thx

              Comment

              • vending_machine
                Confirmed User
                • Jun 2002
                • 1070

                #8
                Originally posted by Buzz_11
                thx
                I don't think anyone understood what you really wanted, so I don't think a thanks is in place.

                Comment

                Working...