Title Name Help

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

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

    Leave a comment:


  • GumSlone
    replied
    use the second solution with $_GET['dir']

    Leave a comment:


  • brentg
    replied
    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.

    Leave a comment:


  • GumSlone
    replied
    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'])))) 

    Leave a comment:


  • brentg
    replied
    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.

    Leave a comment:


  • GumSlone
    replied
    PHP Code:
    end(array_filter(explode("="$_SERVER['REQUEST_URI']))) 

    Leave a comment:


  • brentg
    replied
    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.

    Leave a comment:


  • brentg
    replied
    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

    Leave a comment:


  • softwarefreak
    replied
    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.

    Leave a comment:


  • brentg
    replied
    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

    Leave a comment:


  • softwarefreak
    replied
    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

    Leave a comment:


  • brentg
    replied
    Thanks mfreak

    where do i exactly put the urldecode

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

    Leave a comment:


  • mFreak
    replied
    use urldecode() .it will remove those %xx codes

    Leave a comment:


  • brentg
    started a topic Title Name Help

    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
Working...
X