Jump to content

araknid

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

araknid's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I am writing a content management system and tried implementing mod_rewrite with it. Then I tried exploding the URL to get the same effect. Here is the code I used to do this: [code]         $path_info = $_SERVER["PATH_INFO"];         if($path_info){             $path_info = explode("/", $path_info);                          $i = 0;             foreach($path_info as $path_part){                 if($path_part != ""){                     if($i == 0){                         $pg = $path_part;                     }elseif($i == 1){                         $page_input = $path_part;                     }else{                         $page_input .= "," . $path_part;                     }                     $i++;                     }             }         } [/code] Both mod_rewrite and exploding URLs causes the same problem. Things can't be linked locally. For example, if my the URL is [a href=\"http://somesite.com/araknid/index.php\" target=\"_blank\"]http://somesite.com/araknid/index.php[/a], I can say: [code]<img src='templates/logo.png'>[/code] and it would world properly. But if the url was [a href=\"http://somesite.com/araknid/index.php/forum/t,12\" target=\"_blank\"]http://somesite.com/araknid/index.php/forum/t,12[/a] it doesn't work because it tries to load [a href=\"http://somesite.com/araknid/index.php/forum/t,12/templates/logo.png\" target=\"_blank\"]http://somesite.com/araknid/index.php/foru...plates/logo.png[/a] , instead of [a href=\"http://somesite.com/ararak/index.php/templates/logo.png\" target=\"_blank\"]http://somesite.com/ararak/index.php/templates/logo.png[/a]. How can I fix this? Thanks in advance.
  2. I have noticed that some sites that use PHP have URLs that look like this: [a href=\"http://sitename.com/category/blah\" target=\"_blank\"]http://sitename.com/category/blah[/a] Such as digg: [a href=\"http://digg.com/science/Man_recites_over_22,000_digits_of_pi,_from_his_memory\" target=\"_blank\"]http://digg.com/science/Man_recites_over_2...from_his_memory[/a] Can someone please tell me how this is done? Thanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.