0

Hi to All.
1. I want a php script that can restrict a user from adding additional image to his account on my site, I the admin should be able to set the restricting for the user. I also want to be able to activate/deactivate this function in the admin section
2. I want users to be able to add things they browse to “add to my list” , just like adding things to a shopping cart.

Thank You.

Edited by dannybarh: n/a

2
Contributors
3
Replies
5
Views
8 Years
Discussion Span
Last Post by Atli
2

Hey.

I'm happy to help you write the code, but I am not going to do it for you. You are going to have to do the heavy-lifting. After all, this is your project, and we are only here to help.

Have you even tried to do this yourself?
What did you do? What went wrong?

Tell us the problem and we will try to point you in the right direction, but we are not your code-monkeys ;-)

Votes + Comments
Well said sir. With you 100% - too many lazy so-and-sos on this forum
correctos!
0

Hey.

I'm happy to help you write the code, but I am not going to do it for you. You are going to have to do the heavy-lifting. After all, this is your project, and we are only here to help.

Have you even tried to do this yourself?
What did you do? What went wrong?

Tell us the problem and we will try to point you in the right direction, but we are not your code-monkeys ;-)

am very sorry if you feel that way, you not my code-monkey/s. all i need is help.if i know how to do this i will not be asking. i thought this a place where people get to learn and share ideas.
any thing i learn here will help others too some time to come.
am just new to php, soon i will be good.

1

i thought this a place where people get to learn and share ideas.

And you are quite right :)
Unfortunately a lot of people try to use us to do their work for them; posting their projects all over asking that we post back the complete solution to their problems, so they can copy it and hand it in to their boss/teacher.

I am not saying you are one of these people, but starting your post with "I want a php script" kind of made you sound like one of them.
Perhaps just an unfortunate choice of words ;)

Anyhow, let me try to get you started on the points you were asking about.

1. I want a php script that can restrict a user from adding additional image to his account on my site, I the admin should be able to set the restricting for the user. I also want to be able to activate/deactivate this function in the admin section

Assuming you use a database for the users and their data, you could simply add a 'active' column to the user database and set it's value to either TRUE or FALSE to reflect each user's status.

Then, when the user tries to upload something, you start by checking if he is active, and if he is not, block his upload attempt.

2. I want users to be able to add things they browse to “add to my list” , just like adding things to a shopping cart.

Assuming, again, that the users are listed in a database, you could add a second table that is linked to the user table and the table containing whatever it is they are browsing. And when a user adds an item to his list, you just add a row in this table, linking the user to the item.

This is called a many-to-many (N:M) relationship. If you Google that term you will no doubt find a number of detailed explanations, so I won't go to much into it here, but such a design usually looks something like:

+-------+   +---------------+   +-------+
| User  |   | User_Item     |   | Item  |
+-------+   +---------------+   +-------+
| id PK |<--| user_id PK FK | ->| id PK |
| name  |   | item_id PK FK |/  | name  |
+-------+   + quantity      |   +-------+
            +---------------+

See what I mean?

Edited by Atli: Typos, grammar.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.