pp wrote:
> Emiliano wrote:
>
>> To keep you busy in the meantime, the selects below do work for me.
>
>
> Yes, my meantime is getting longer and longer.... :)
>
> Emile , the point is, that I need fetch topics not articles,
> my select for topics works fine , but I can not add article
> with topic's ID from option value.
You mean something like below (which works for me?):
Emile
<FORM ACTION="/example/select/" METHOD="POST">
<SELECT NAME="topic">
<Option value="" selected>-------------</option>
<? $topiclist = mgd_list_topics(7);
while ($topiclist && $topiclist->fetch()) { ?>
<OPTION VALUE="&(topiclist.id);">&(topiclist.name);
<? } ?>
</SELECT>
<BR>
Title: <input type="text" name="title" size="40"><BR>
<TEXTAREA name="content" rows="20" cols="80" wrap="off"></TEXTAREA>
<P>
<INPUT TYPE="submit" NAME="add" VALUE="Add">
<INPUT TYPE="submit" NAME="list" VALUE="List">
<INPUT TYPE="reset">
</FORM>
<P>
<?
if ($list) {
if ($topic && ($topic = mgd_list_topic_articles($topic))) {
echo "<UL>";
while ($topic->fetch()) {
echo "<LI>", $topic->title, "</LI>";
}
echo "</UL>";
}
} else if ($add) {
if (!$topic) { echo "<b>please select a topic</b>"; }
else if (!$title) { echo "<b>please type a title</b>"; }
else if (!$content) { echo "<b>please type content</b>"; }
else {
$user = mgd_auth_midgard("guess", "again", 0);
if (mgd_create_article(0, $topic, $title, $title, "", $content, $user,
"", "", 0, 0, 0, 0,
0, 0, 0, 0)) {
echo "<b>Article added</b>";
} else {
echo "<b>Add failed: ", mgd_errstr(), "</b>";
}
}
}
?>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]