Jump to content
Weiss

Sticky notes

Recommended Posts

Hi. Im trying to make an online sticky notes system. each user will be able to subscribe to number of boards. each board will hold memos. so in case me and my friend are subscribed to the same board (we can both subscribe to different boards also regardless) and i put a memo on that board, my friend will see that memo also. So... i crated the sql database, and now when the user logged in, he is automatically see the boards he's subscribed to and the memos on that board. only thing is, i want him to be able to add memo to a board. as for now, the script takes the userid, then run sql query to check his subscribed boards and saves the boards id on an array, after that, on each board, the script loops thru the memos on the database to see which memo is connected to that board id and then display it. so im not sure how can i do the Add note thingy here, i thought about making a little form inside each of the display boards, a simple <teaxtarea> and <submit> and when user submit i run the SELF PHP page and insert a query. ONLY problem is, how can i know which of the forms did the user submitted? if there could be a way the form could hold the board id number inside of it.. is there a way to do that? im posting a pic to try to explain what i mean.

**You can see the title of the board in pink, after that all notes float left and the form comes after the notes. in this example to user subscribed to 2 boards. thank you

dd.PNG

Share this post


Link to post
Share on other sites

If you're showing multiple boards and forms on the page then yeah, you need to add the board ID to each form to make them unique.  You can make it a hidden input, or add it to the form action URL.

  • Like 1

Share this post


Link to post
Share on other sites

It probably makes sense to use ajax to submit the data to the server, that way you don't have to refresh the page.  There's plenty of information about ajax online.  When you build that page in PHP and write out the button to call the function to run the ajax request, you can pass the board ID to that function.

If you don't want to use ajax then you can have your PHP form processing code on the same page, all of the PHP code like that should go on the top of the page before you display anything.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...