hi
now that i've finished understanding some concept of web, i come to
practice, and my question is simple and basic for any beginner, but
there is no answer in the web;
how to make a simple page where a user click on 'add' and sees the
items there.
in basic python it's simple to make it with a dictionary, but how to
translate this to something between html and python (tornado in this
case).
am sorry if it's a big thing that am asking for, but this is the
problem that i always face: how to add a VISUAL dictionary item.
thank you in advance :)
from the basic idea, it's something related to the database, so in the
database interface you can add/remove (restful in the case of nosql),
but when doing so, it's an administrator with a special URI, but what
about a user that want to add a thing, how to handle all this? am i
complicating thing?
i've no background in php, and all websites i've found it seems that
they're done using php. so can you please help me here.
The standard way (but by no means the only one) to implement such thing is
to:
1. Write an html page with a form
2. Name the form somehow (for example: "myForm"), give it an action (for
example: "/add") and a method (for example: "post")
3. Populate the form with many "input" fields (named for example:
"field1", "field2", etc.) and add a "submit" button
4. In your webserver, implement a handler responding to "post" requests
going to "/add"
5. Inside your handler, you'll be able to access the fields of the forms
using "self.get_argument('field1')", etc.
6. Whatever the server replies will be show on the page. If you only
want to update "portions" of the page, you should look at how to do "ajax"
requests.
hth,
L.
On Tue, Jun 26, 2012 at 2:47 PM, aliane abdelouahab <alabdeloua...@gmail.com
> wrote:
> from the basic idea, it's something related to the database, so in the
> database interface you can add/remove (restful in the case of nosql),
> but when doing so, it's an administrator with a special URI, but what
> about a user that want to add a thing, how to handle all this? am i
> complicating thing?
> i've no background in php, and all websites i've found it seems that
> they're done using php. so can you please help me here.
wow! that's an excellent tutorial, thank you!
sorry because i'm a beginner and it's really difficult to jump from
the world where they say: dictionnary in python is ... as an exemple
test['hello']= something, but when it come to apply this to html, it's
something else! :p
thank you again, i'll try to understand well that logic.
On 26 juin, 15:26, Lorenzo Bolla <lbo...@gmail.com> wrote:
> The standard way (but by no means the only one) to implement such thing is
> to:
> 1. Write an html page with a form
> 2. Name the form somehow (for example: "myForm"), give it an action (for
> example: "/add") and a method (for example: "post")
> 3. Populate the form with many "input" fields (named for example:
> "field1", "field2", etc.) and add a "submit" button
> 4. In your webserver, implement a handler responding to "post" requests
> going to "/add"
> 5. Inside your handler, you'll be able to access the fields of the forms
> using "self.get_argument('field1')", etc.
> 6. Whatever the server replies will be show on the page. If you only
> want to update "portions" of the page, you should look at how to do "ajax"
> requests.
> hth,
> L.
> On Tue, Jun 26, 2012 at 2:47 PM, aliane abdelouahab <alabdeloua...@gmail.com
> > wrote:
> > from the basic idea, it's something related to the database, so in the
> > database interface you can add/remove (restful in the case of nosql),
> > but when doing so, it's an administrator with a special URI, but what
> > about a user that want to add a thing, how to handle all this? am i
> > complicating thing?
> > i've no background in php, and all websites i've found it seems that
> > they're done using php. so can you please help me here.