why does this code doesnt work ?????

Discussion in 'PHP' started by subzero27, Jun 27, 2007.

  1. #1
    I just cant figure out whats wrong with this code -

    my friend made it to make the title to be attached along with the url to make it se friendly.The url comes like www.domain.com/page-title.html

    here is the code and teh instructions that he told me to do-

    http://muzica.x6.ro/melodia/strength-of-a-woman-3442.html

    1) copy script melodia.php as melodia

    2) add following script at the top

    $infoArr = explode("/",$_SERVER["PATH_INFO"]);
    $title = $infoArr[1];
    $title = eregi_replace("\.html","",$title);

    $titleArr = explode("-",$title);

    $id = $titleArr[count($titleArr)-1];

    3) add following code in .htaccess

    AcceptPathInfo on // use only if apache 2

    <Files melodia>
    ForceType application/x-httpd-php
    </Files>

    but where do i attach this code and when i attach the respective code to .htaccess file the server shows error. I am really clueless...please help me.
     
    subzero27, Jun 27, 2007 IP
  2. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #2
    ansi, Jun 27, 2007 IP