Title Name Help

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

    Title Name Help

    Hi All

    i got a small problem that hopefully someone can help.

    For the 'title' i have this code but it outputs with all the 'symbols', what can i change to remove all the symbols and '&sort=1'

    PHP Code:
    echo '<title>'.str_replace(".php","",basename($_SERVER['REQUEST_URI'])).' |'.$_SERVER['HTTP_HOST'].'</title>'
    but the title name shows as:

    Kid%20Cudi%20-%20Creepers.mp3&sort=1 |SiteName
    what can i do to make it show like this:

    Kid Cudi - Creepers.mp3 | SiteName

    #2
    use urldecode() .it will remove those %xx codes
    PHP Code:
    $("#mfreak").find(".head brain").clone(); 
    Progress:
    Code:
    [|||___________________________] : 5%
    Output:
    Code:
    Memory limit reached, unable to complete operation.
    Support answer:
    Code:
    Try using a super uber strong mega computer to reach at least 10%.

    Comment


      #3
      Thanks mfreak

      where do i exactly put the urldecode

      Code:
      '.str_replace(".php","",basename($_SERVER['REQUEST_URI'])).'

      Comment


        #4
        PHP Code:
        $title rawurldecode(str_replace(".php"""basename($_SERVER['REQUEST_URI'])));
        $title preg_replace("#&sort=[0-9]+#i"''$title);
        echo 
        "<title>$title | " $_SERVER['HTTP_HOST'] . "</title>"
        If this doesn't works copy & paste the URL of the page here
        I need some facebook likes, can you please help me
        http://facebook.com/softwarefreakin
        I noticed social media is really powerful
        Well DONE is better than well SAID

        Comment


          #5
          thanks software,

          i tried the code, never worked edited and the symbols were gone but my content never showed?

          Here we go: 2%20Chainz%20ft%2050%20Cent%20-%20Riot%20%28Remix%29.mp3&sort=0|PlayWAP.Mobi

          Thanks

          Comment


            #6
            Originally posted by brentg View Post
            thanks software,

            i tried the code, never worked edited and the symbols were gone but my content never showed?

            Here we go: 2%20Chainz%20ft%2050%20Cent%20-%20Riot%20%28Remix%29.mp3&sort=0|PlayWAP.Mobi

            Thanks

            I guess in your script, mysql_connect is used after sending the head of the html, you cud have used the filename in the title directly from db records,
            anyways, you may use the below code
            PHP Code:
            $title basename($_GET['file']);
            echo 
            "<title>$title | " $_SERVER['HTTP_HOST'] . "</title>"
            Last edited by softwarefreak; 16.09.12, 07:24.
            I need some facebook likes, can you please help me
            http://facebook.com/softwarefreakin
            I noticed social media is really powerful
            Well DONE is better than well SAID

            Comment


              #7
              thanks so much software its working now, my script does not use sql

              Im using this:
              PHP Code:
              echo '<title>'.$title basename($_GET['file']).'|PlayWAP.Mobi</title>'
              2 Chainz ft 50 Cent - Riot (Remix).mp3|PlayWAP.Mobi

              Sorry one more question, what code like the above can i use for the folder titles.

              |PlayWAP.Mobi

              Thanks

              Comment


                #8
                Hi guys sorry to bring this up again but i need add the folder name to my header to further help with SEO.

                at the moment i got this code as my header in index.php (Autoindex script)

                Im using:
                PHP Code:
                echo '<title>'.str_replace(".php","",basename($_SERVER['REQUEST_URI'])).'|PlayWAP.Mobi</title>'
                and it shows:

                Code:
                index?p=0&sort=1&dir=Wallpaper | PlayWAP.Mobi:
                I would like it to show like: Wallpaper | PlayWAP.Mobi

                I googled all functions, tried them all. They returning as error or doesn't do anything.

                Thanks so much
                Last edited by brentg; 28.03.13, 00:15.

                Comment


                  #9
                  PHP Code:
                  end(array_filter(explode("="$_SERVER['REQUEST_URI']))) 
                  Advertise your mobile site for FREE with AdTwirl

                  Comment


                    #10
                    Gumslone THANK YOU SO MUCH!!!



                    Added after 28 minutes:

                    Hi Gumslone I just had a look on other pages and titles with spaces return as eg. Music%20Videos | PlayWap.Mobi anything I can add into the code to remove those symbols. Thanks
                    Last edited by brentg; 28.03.13, 16:47.

                    Comment


                      #11
                      yes
                      PHP Code:
                      str_replace('%20'' 'end(array_filter(explode("="$_SERVER['REQUEST_URI'])))) 
                      or you could also do:
                      PHP Code:
                      str_replace('%20'' 'end(array_filter(explode("/"$_GET['dir'])))) 
                      Advertise your mobile site for FREE with AdTwirl

                      Comment


                        #12
                        AWESOME! It works, Thanks a million Gumslone.

                        Im gonna sound like nuisance now but my auto index script has sort by name and date.

                        When i sort by date then your above code works and shows: Music Video | PlayWap

                        But when its sorted by name (default) like this: /dl/index.php?dir=/Music Videos&p=0&sort=0

                        The code above makes the title - 0&sort | PlayWAP

                        I know its not a biggy but if you dont mind and if there is a another piece of code I can use, I would really appreciate it.

                        Thanks again

                        EDIT: I just saw the other code you posted, that seems to make it all work! A million thanks man!!!!
                        Last edited by brentg; 29.03.13, 07:43.

                        Comment


                          #13
                          use the second solution with $_GET['dir']
                          Advertise your mobile site for FREE with AdTwirl

                          Comment


                            #14
                            Originally posted by GumSlone View Post
                            use the second solution with $_GET['dir']
                            THANKS! Gumslone

                            Comment

                            Working...
                            X