1.) Where is tag set? You reference it in the else statement, but I don't see it set.
2.) You're kind of going about it all wrong.....
The ID of an element is just that, a referential ID. It isn't used in PHP, but rather in CSS / HTML. So having the value tag[] as the ID won't do you any good. What you need to do is reference the [man]sizeof/man... or better yet, do a foreach() loop.
Something like the following:
<?php
$id = $_GET['blogid'];
if (!isset($_POST['submit'])){
$a = phpfox_mysql_query("SELECT * FROM `tags` WHERE `blog_id` = '$id'");
$MAINDATA .="
<br />
<font style='color:#2EA7EC;font-size:12px'><b>Edit your blog tags.</b></font><br />
<font style='color:#000000;font-size:9px'>
* To delete - Leave the box blank<br />
* To add - Click this link [here] this will add 5 more forms. <br />
</font>
<br />
<form method='post' action='$php_self?edit=tags&blogid=$id' style='margin:0px;'>
";
while ($b = mysql_fetch_array($a)) {
$MAINDATA .= '<input type="text" name="words[]" value="'.$b[word].'"><br />';
}
$MAINDATA .="
<div style='background-color:#2EA7EC;width:25%;padding:4px;' align='left'>
<div align='center'>
<input type='submit' value='Update Tags'>
</div>
</div>
</form>
";
} else {
// echo('test'); // We won't be needing this any more ;)
//for($c = 0; $c < sizeof($tag); $c++) {
foreach($_POST['words'] AS $word) {
//$tagword = $_POST['word'];
//echo($tagword);
//echo($tag);
$query = "UPDATE `tags` SET `word`='$word' WHERE `word`='$???'";
mysql_query($query) or die(mysql_error());
}
}
?>
Not sure where you're pulling your conditional stuff from, but it seems you need a hidden form element for each word you want changed, so you have tag to go with it. But the code above is a start for you.