Jump to content

FFD Edit


Valkeri2010

Recommended Posts

hello mates,

 

I am needing help on editing a line in Flat File Database.

 

I got it to pull the data i need out by using id but not sure on how i would go about getting it to update the FFD

 

heres what i got so far

 

$id2 = $_REQUEST['id'];

$id = array();
$username = array();
$title = array();
$date = array();
$message = array();
$lines = file('../news/news.db'); 
foreach($lines as $line){ 
if($id != $id2) {
    $explode = explode("||",$line);
$id = $explode[0]; 
    $username = $explode[1];
$title = $explode[2];
$date = $explode[3];
$message = $explode[4];
} 
}
?>
      <form action="edit_news2.php?id=<?php echo $id; ?>" method="post" name="editnews">
        <table width="100%">
	  <tr><td><input name="id" value="<?php echo "$id;" ?>" type="hidden" />UserName:</td><td> <input name="userName" value="<?php echo "$username" ?>" type="text" readonly="true"  /></td></tr>
          <tr><td>News Title:</td><td> <input name="title" type="text" value="<?php echo "$title"; ?>" /></td></tr>
          <tr><td>Date/Time:</td><td> <input name="datetime" value="<?php echo "$date"; ?>" type="text" readonly="true" /></td></tr>
          <tr><td colspan="2">Message:</td></tr>
	  <tr><td colspan="2"><textarea name="message" cols="50" rows="15"><?php echo "$message"; ?></textarea></td></tr>
          <tr><td colspan="2" align="center"><input type="submit" name="submitBtn" value="Post News" /></td></tr>
        </table>
      </form>

 

 

thank you

Valkeri2010

Link to comment
https://forums.phpfreaks.com/topic/218420-ffd-edit/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.