Ninjakreborn Posted June 2, 2006 Share Posted June 2, 2006 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 Link to comment https://forums.phpfreaks.com/topic/11027-getting-approval/ Share on other sites More sharing options...
wildteen88 Posted June 2, 2006 Share Posted June 2, 2006 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 NNow 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. Quote Link to comment https://forums.phpfreaks.com/topic/11027-getting-approval/#findComment-41184 Share on other sites More sharing options...
Ninjakreborn Posted June 2, 2006 Author Share Posted June 2, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/11027-getting-approval/#findComment-41187 Share on other sites More sharing options...
poirot Posted June 2, 2006 Share Posted June 2, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/11027-getting-approval/#findComment-41189 Share on other sites More sharing options...
wildteen88 Posted June 2, 2006 Share Posted June 2, 2006 If he declines then have another link which deletes it out of the database. Therefore it doesnt overload the database with data that is not needed. Quote Link to comment https://forums.phpfreaks.com/topic/11027-getting-approval/#findComment-41190 Share on other sites More sharing options...
Ninjakreborn Posted June 2, 2006 Author Share Posted June 2, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/11027-getting-approval/#findComment-41224 Share on other sites More sharing options...
legohead6 Posted June 3, 2006 Share Posted June 3, 2006 [!--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> Quote Link to comment https://forums.phpfreaks.com/topic/11027-getting-approval/#findComment-41378 Share on other sites More sharing options...
jeremywesselman Posted June 3, 2006 Share Posted June 3, 2006 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--] Quote Link to comment https://forums.phpfreaks.com/topic/11027-getting-approval/#findComment-41382 Share on other sites More sharing options...
Ninjakreborn Posted June 3, 2006 Author Share Posted June 3, 2006 Ok sounds good I will set that up, and I can just have it remove it from the database automatically if he declines. Quote Link to comment https://forums.phpfreaks.com/topic/11027-getting-approval/#findComment-41438 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.