WEB Retard question about using a script for meta/title tags...

Discussion in 'OT Technology' started by shaitaan, Jan 19, 2010.

  1. shaitaan

    shaitaan New Member

    Joined:
    Jul 12, 2002
    Messages:
    49,620
    Likes Received:
    0
    Location:
    Bay Area, CA / NYC
    hey guys,

    I'm super rusty on php, so please forgive my retardation..

    I'm using this script:

    http://www.hawkee.com/snippet/3640/


    Code:
    
    <?php
     
    $database = 'meta_tags.txt';
    $meta_db = fopen($database, 'r');
     
    $page = $_SERVER['SCRIPT_NAME'];
    $page = substr($page, 1);
     
    while($data = fgetcsv($meta_db, 9000, '|'))
    {
    	if($data[0] == $page)
    	{
                    $title = $data[1];
    		$meta_keywords = $data[2];
    		$meta_description = $data[3];
    	}
    }
     
    ?>
    


    my problem is that I still can't get it to work for any pages within subdirs; it only works for pages in the root dir :(


    little help? :x:
     
  2. shaitaan

    shaitaan New Member

    Joined:
    Jul 12, 2002
    Messages:
    49,620
    Likes Received:
    0
    Location:
    Bay Area, CA / NYC


    negative on both :(
     
  3. shaitaan

    shaitaan New Member

    Joined:
    Jul 12, 2002
    Messages:
    49,620
    Likes Received:
    0
    Location:
    Bay Area, CA / NYC
    this has to do w/ some f'ed up pathing, huh...
     
  4. shaitaan

    shaitaan New Member

    Joined:
    Jul 12, 2002
    Messages:
    49,620
    Likes Received:
    0
    Location:
    Bay Area, CA / NYC
    nah, the setup is..

    In root:

    index.php -> has the reference to header.php in it
    meta_tags.txt

    In /includes/:

    header.php --> has the reference to get_meta.php in it
    get_meta.php


    and the page that wont display meta is:

    /features/index.php


    :wtc:
     

Share This Page