Jump to content

i want to allow users to post in the website, what is the function that i can use? with php and mysqli


bouriche
Go to solution Solved by lovephp,

Recommended Posts

for that create a table as comments store id, product id, user id, post text, post date. thats all you need.

 

i believe you already have the table ready so where is the issue?

no i don't have that table, so you want me to create a table and in that table will be the product id from products table and user id from users table? 

Link to comment
Share on other sites

The question is far, far too vague. Nobody is going to write a 50-pages “How to implement a publishing system” tutorial.

 

Break your project into concrete tasks and then ask specific questions, ideally with actual code.

yea it is but i don't need a tutorial just i need to know the way to do that if i know the idea and the way i will do it myself, thank you

 

by the way i have this problem can you help me in that: 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at F:\Inetpub...\index.php on line 3

Link to comment
Share on other sites

i want to allow users who registred an the website to post

 

 

i didn't know how to get user id

 

you would only allow logged in users to post. your log-in system would store the user id in a session variable. you would both test if the session variable is set before presenting any output needed to post comments and processing any form submission and you would get the user id from the session variable when forming and running the INSERT query to save the posted comment.

 

and pruduct id

 

 

you would get the product id from the content you are displaying that you are allowing comments to be posted for.

Edited by mac_gyver
  • Like 1
Link to comment
Share on other sites

by the way i have this problem can you help me in that: 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at F:\Inetpub...\index.php on line 3

 

session_start() needs to be called before anything is outputted to the screen. If you need further help, you'll need to post some code.  :happy-04:

  • Like 1
Link to comment
Share on other sites

 

you would only allow logged in users to post. your log-in system would store the user id in a session variable. you would both test if the session variable is set before presenting any output needed to post comments and processing any form submission and you would get the user id from the session variable when forming and running the INSERT query to save the posted comment.

 

 

you would get the product id from the content you are displaying that you are allowing comments to be posted for.

i did that and it work, thank you !!

all the best

Link to comment
Share on other sites

Like mac_gyver said it's all in the session, if you need further help post ur coding here.

 

Like mac_gyver said it's all in the session, if you need further help post ur coding here.

i did that and it work very well, you guys help lot thank you,

 

i will start working now in the messaging system and contact, with notifications

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.