View Single Post
Old 04-10-2005   #8 (permalink)
scrowler
code anyone?
 
scrowler's Avatar
 
Join Date: Feb 2004
Location: New Zealand
Posts: 590

Send a message via MSN to scrowler Send a message via Skype™ to scrowler
solution: something like this:
Code:
<?php
if($_GET['article_id']){
  $sql = "DELETE FROM news WHERE id = '".$_GET['article_id']."' LIMIT 1";
  # ...
} else {
  $sql = "SELECT id, Title FROM news ORDER BY id DESC";
  while($row = mysql_fetch_assoc(mysql_query($sql)))
    echo '<p>
             <a href="'.$_SERVER['PHP_SELF'].'?article_id='.$row['id'].'">Edit: '.$row['Title'].'</a>
             </p>';
}
?>
obviously run some checks on the var like:
Code:
if(!is_numeric($_GET['article_id'])) die("article_id is not a numeric number1");
__________________
BioRUST Tutorials - the birthplace

Last edited by scrowler; 04-10-2005 at 09:41 AM..
scrowler is offline