Removing article with ID from URL
<p>Im building this blogg site and finally got everything considering uploading multiple pictures to one news article done.</p>

<p>Now my second step is to remove an article with following pictures to it.
Everything is set in the database so all i need is an ID from the news article.</p>

<p>When i press remove button on a article it shows the ID up in the URL... Im wondering how to get the specifik ID int from the URL and IF there is an smarter approach. It must be OOP and objectoriented apporach.</p>

<p>Code looks like this:</p>

<p>This is the looping out each article and notice $current_id that i put into a button to show in the url when its pressed</p>

<pre><code>    public function doOutputArticles($newsList, $pictureList)
    {

        $result = '';
        foreach($newsList as $news)
        {
           $result .= '&lt;ul&gt;';   
           $current_id = $news-&gt;dbNewsID;
           $result .= '&lt;li class="bloggNewsHeader"&gt;'.$news-&gt;dbHeader.'&lt;/li&gt;';
           $result .= '&lt;li class="bloggNews"&gt;'.$news-&gt;dbNews.'&lt;/li&gt;';
           $result .= '&lt;li class="bloggNewsDate"&gt;'.$news-&gt;dbNewsDate.'&lt;/li&gt;';
           foreach($pictureList as $pic)
           {
              if($pic-&gt;dbNewsID == $current_id)
              {
                $result .= '&lt;li class="bloggNewsPicID"&gt;'.$pic-&gt;dbPictureID.'&lt;/li&gt;';
                $result .= '&lt;img class="bloggNewsPic" src="./images/'.$pic-&gt;dbPicture.'"alt="some_text"&gt;';
              }  
           }
           $result .= "
                        &lt;form id='' method='get'&gt;
                            &lt;input type='hidden'    name='$current_id'/&gt;
                            &lt;input type='submit'      name='removeArticle' value='Ta bort inlägg' /&gt;
                        &lt;/form&gt;";

           $result .= '&lt;/ul&gt;';
        }
        return "&lt;div id='filesLoaded'&gt;". $result ."&lt;/div&gt;";

    }
</code></pre>

<p>`</p>

<p>After this is done, i press a button to remove specific article and then the ID shows in the URL, now this method is meant to GET the specific INT/NUMBER ID in the URL but HOW?</p>

<pre><code>public function GetSelectedID()
    {       
        $ID = $_GET[self::$articleId];
        echo $ID;

        if(is_null($ID) || empty($ID))
        {
             return null;
        }
        else
        {
            echo $ID;
            return $ID;
        }

    }
</code></pre>

<p>`<br>
Kind regards /Haris</p>
