Jump to content

B.O.V.N

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

B.O.V.N's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello. I am now done with my comment function, created to grant the visitors the possibility to comment an article. But there is one thing that I cannot solve (Note: It has been three weeks since I first started to use PHP) so therefore I thought that somebody might be so kind to help me with my problem. [b]My problem[/b] It is in my index.php where I have some previews of articles and other stuff, but most importantly in this issue the function to see the latest 3 comments. And in these boxes I have created a link that will direct the visitor to the certain HTTP adress where the commented article is located. Now the pop-up box where you comment an article has a function that will fetch the article ID of the article and create a comment site with the same ID. Here is a typical link to an article: http://www.mysite.com/articles/200604/21/20060421151548_Site440/20060421151548_Site440.dbp.asp Don't ask why the article's are made in ASP and the comments in PHP :) Long story :) Anyway the link that will link to its mother (the articles HTTP) is created in the way that you can see in Listing 1: [b]Listing 1[/b] [code] $link = 'http://www.mysite.com/articles/'.substr($article_id, 0, 6).'/'.substr($article_id, 6, 2).'/'.substr($article_id, 0, 22).'/'. $article_id;[/code] So in other words the ID of the article is for an example 20060421151548_Site440.dbp.asp and the function above will make that the link will automatically link to the correct folder/sub-folder etc. But the problem is this: most of the time the article ID does not include "Site" and is therefore only; 20060421151548_440.dbp.asp. But my code will therefore generate the following link: http://www.mysite.com/articles/200604/21/20060421151548_440.dbp/20060421151548_Site440.dbp.asp which will link to a non-existing site. It should be http://www.mysite.com/articles/200604/21/20060421151548_440/20060421151548_440.dbp.asp But how do I manage to do this without f***ing with the links that has Site in them? Thankful for help.
×
×
  • 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.