> >
> 
> > you can use if($action) but you need to declare the submit button like this:
> > <input type="submit" name="action" value="Submit">
> >
> well , it is almost original admin site and I just added my code for
> selecting
> where article must be added
> 
> Going back:
> my only problem is _how to put value from select to further code_?
> just only one value
> 
> <select name="xxx">
> <option value="1">
> <option value="2">
> etc...
> </select >
> 
> and my article's topic should be $xxx?
> 

Are you doing totally your own routines for adding articles or using
parts of the 1.2.5 admin site ?

The way I have been doing it is having one form that gets the needed
info and then have a handler page that reads $action and acts
accordingly (creates, modifies and deletes articles) if needed
parameters are present.

This form calls a handler and provides it with two variables
$action which in this case is hardcoded to be "add_article" and
$topic that has the value from the select pull-down. (I didn't test this
code and it's not a direct copy from a working one, but it should work)

----snip----
<form method=post action="handler.html">
<input type=hidden name="action" value="add_article">
Select Topic: <select name="topic">
<option value="" selected>Pick one</option>
<?php $topics=mgd_list_topics($root_topic);
if ($topics) {
    while ($topics->fetch()) {
        ?><option value="&(topics.id);">&(topics.name);</option><?
    }
} ?>
</select>
<input type=submit name=submit value=submit>
</form>
----snip----

Now you might want to add other fields as well (like title and so on)
here or have the handler ask for them if needed (but then you need to
have the handler to call back to itself to save all the data in one
call).

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to