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


Go to solution Solved by lovephp,

Recommended Posts

hi, i hope you can help me in this, i want to allow users who registred an the website to post , i created a table for posts and for users in mysql and i want to know how to allow users to publish posts.

thank you.

That depends on what you want them to post? A blog, forum or what? U create a mysql table posts with auto increment of id then store users id to a field and whatsoever fields of your choice.

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.

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? 

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

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?

You would need these i believe

 

id

product_id

member_id

comments

date

You would need these i believe

 

id

product_id

member_id

comments

date

i tried to do that but i didn't know how to get user id and pruduct id from their tables to the new table, can you explain that to me ?

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

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

i tried to do that but i didn't know how to get user id and pruduct id from their tables to the new table, can you explain that to me ?

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

 

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

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:

yeah !! that is true, it work now thank you 

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

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.