Jump to content

getting approval


Ninjakreborn

Recommended Posts

This is primarily about php, because that is what I need to do this. I need to do the regular, get someone to submit a form, it goes into a database after validation. But I need to add an extra feature and I don't know how, I know how to set up a control panel to let him, add and delete data. but what I don't understand now pretty much is I need to get it to where when someone submits the information(it has 3 text fields, and an attachment), the attachment, could be an email video, or anything, I need to be able to take the whole submission, text fields, attachment and everything, and somehow send an email to the client I have to look over and approve, and then if he approves, then accept, and THEN it goes in the database, if he declines, then it discards it
Link to comment
Share on other sites

For what you want to do is actually a simple process.

All it requires for you to do is have an extra coloumn within the table that stores the attacments which is called [b]approved[/b] or something similar, which stores an ENUM value thats stores either Y (for yes) or N (for no) and its formated like so:
[code]approved ENUM('Y', 'N') DEFAULT 'N'[/code]

Now what you do is this. When a user submits attachments it goes into the database and by defualt MySQL will set value of of approved for that attement to N for no. Then when you go to display the attachements you use query like so:
[code]SELECT * FROM tableName WHERE approved='Y'[/code]
What will happen is, mysql will only select the rows from the table that stores the attaments that have approved field set to Y. It will not select any fileds that have it set to N

Now all you need to do is send a link to the Admin of the site that contains a link which changes the value of the approved field for that attachment to Y allowing it to be deisplayed.

and thats it! It requires very basic programming to achieve. Nothing too advanced. All you are doing is comparing values in a database and updating the values accordingly.
Link to comment
Share on other sites

hmm, I will give that a try, is there also a way, to have it not add it at all unless he approves, or is that impossible, if it is then I am going to try the first way. There's limited database space on his server, the company he owns has like 2000 sites all on one massive server, and he has each site in a different folder, and a different url pointing to each folder, so he wants to avoid putting anything that is unnessecary in the database, not saying the database can't handle infinite intries, but He wants to keep only the stuff in the database, that he approves of, completely.
Link to comment
Share on other sites

Another alternative is, create a temporary table where information submitted will be recorded.

Then, if it's approved you rewrite it to another table.
If it's not approved, remove it from the temporary table.

This way you won't have defunct records ;)

[b]EDIT:[/b] What I mean with temporary table is not a table that will be created and deleted, but a table made to hold temporary records.
Link to comment
Share on other sites

I have an idea.
How about this, is this possible.
I have ok, I think I can time scripts.
So I can do this, for instance, I have it send the information to a page, then I validate it, and send a mail script right then with a url to that page. He clicks the url and goes to the page(I will have something in my script to have php wait until he gets to the site), when he gets to that page, then my script will run an if else statement, he has 2 choices after he looks at it, accept/decline. If he accepts it runs a section of my script and then emails the confirmation the person letting them know, emails the confirmation to my client letting him know it worked, and then it adds the information into the database. If he declines the in just runs a section of the script telling him, the information has been declined, and then kills the script, without doing anything further, I would have to use session or something, any advice, do you think this could work.
Link to comment
Share on other sites

[!--quoteo(post=379332:date=Jun 2 2006, 09:21 AM:name=businessman332211)--][div class=\'quotetop\']QUOTE(businessman332211 @ Jun 2 2006, 09:21 AM) [snapback]379332[/snapback][/div][div class=\'quotemain\'][!--quotec--]
This is primarily about php, because that is what I need to do this. I need to do the regular, get someone to submit a form, it goes into a database after validation. But I need to add an extra feature and I don't know how, I know how to set up a control panel to let him, add and delete data. but what I don't understand now pretty much is I need to get it to where when someone submits the information(it has 3 text fields, and an attachment), the attachment, could be an email video, or anything, I need to be able to take the whole submission, text fields, attachment and everything, and somehow send an email to the client I have to look over and approve, and then if he approves, then accept, and THEN it goes in the database, if he declines, then it discards it
[/quote]

you could use a confirmation number system..when it emails it emails a number and then they go to another page on ur site and enetr that code brining you to a accept or decline thing.... if decline it removes the data from the database if its accepted you could add another colum in the datbase and make it like active and make it TRUE if they click accept

[!--quoteo(post=379547:date=Jun 2 2006, 11:56 PM:name=legohead6)--][div class=\'quotetop\']QUOTE(legohead6 @ Jun 2 2006, 11:56 PM) [snapback]379547[/snapback][/div][div class=\'quotemain\'][!--quotec--]
you could use a confirmation number system..when it emails it emails a number and then they go to another page on ur site and enetr that code brining you to a accept or decline thing.... if decline it removes the data from the database if its accepted you could add another colum in the datbase and make it like active and make it TRUE if they click accept
[/quote]

or bupass the going to your site and entering a code with a link like www.mysite.com/activate.php?activation=<i>the number</i>
Link to comment
Share on other sites

Any feasible way you do it, you ARE going to have to store the data in the database. You need to stop looking for ways around it and just code it for database storage.

[!--coloro:#990000--][span style=\"color:#990000\"][!--/coloro--]Jeremy[!--colorc--][/span][!--/colorc--]
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.