Results 1 to 3 of 3
Thread: Script Question/Problem
May 1, 2001, 10:40 #1
I have a simple script that allows a user to input some info into my database. But, no matter what I do, there is no way I can make sure that what they enter is relative to what I want. So what I want to be able to do is authorize stuff that is to be added to the database. I don't know where to start here. I'm not asking for the code, just somewhere to start. I have it where the user submits the data, then if I don't like it, I have to go and delete it, I would like it to come to me, I think I could even make a mail script that mails is to me. All I want are the options of delete and add for each one. I could tweak it to let me edit stuff.
May 1, 2001, 10:52 #2
- Join Date
- Jun 2000
- Sydney, Australia
- 0 Post(s)
- 0 Thread(s)
Here's a thought. Go ahead and save that user data in your database as your script processes the user's input. You might want to ad some code to the form processing script that emails you letting you know a new record has been added and the details.
However, add a field to the database table and call it "Approved" and make it a varchar(1) with a default value of '0' for false. Then you can write some sort of script that queries the database and retrieves the submissions pending approval. You can read them and decide whether to approve them or not which you can do using a form which will then either update the record in the database and mark it with a value of '1' which flags that it is approved, or delete the record if you reject it.
Now elsewhere in other scripts, if you want to retrieve all the approved records then as part of your sql query you add "... WHERE Approved = '1' " and that way only the records that have been approved are retrieved (and not the ones pending approval).
Does that sound like something that would work?
May 1, 2001, 18:39 #3