complete php order form with discount code check
$30-250 USD
Paid on delivery
This is our initial position:
- there are two simple php files: php1 for an orderform, php2 for checking and confirmation
- php1 is an order form, where the customer can put in his address before ordering.
- there is also a field for "discount code". If the customer has a discount code, he can put it herein to get a discount.
- with a submit button, the php2 is called.
- php2 checks address data for completness.
- check is done with simple "if" queries
- if the address is incomplete, it goes back to order form
- if the address is ok, order will be sent
- discount code is checked manually
-----------------------------------------------------------
This is what we need:
- php3: discount code validation and mark discount code as obsolete
- at submitting the discount code must be validated
- additional we provide a "[login to view URL]" file, wich is edited manually.
- this is an example of [login to view URL]:
12345678901234;26.11.2012;24.11.2012
12374278901233;30.11.2012;25.11.2012
82345678421230;30.11.2012;
55345685671236;26.11.2012;
- [login to view URL]:
-- format is text/csv
-- seperator is semicolon ;
-- there is no header line
-- each line is one discount code
-- three fields: fields one/two are predefined, field three is controlled by php3
-- first field is the discount code, alphanumeric, up to 20 charcaters, no spaces
-- second field:expiry date; date format: [login to view URL]
-- third field: date of cashing the discount; date format: [login to view URL]
- validating with php3:
-- validating must be processed in a separate php3 file. php2 calls the new php3 as a function. php3 returns only true/false (valid/not valid).
-- so the only change in php2 is the new function call to php3 and if the check fail and additional error message.
-- new php3 function:
--- get the customer discount code from php2 as parameter
--- read each line in the csv file and compare with predefined discount codes with our customer discount code until it finds an exact match
--- discount code is only valid if:
---- predefined discount code matches complete with customer discount code (not case sensitive)
---- predefined discount code has same length than customer discount code
---- current date is less or equal than "expiry date" (second field in line)
---- third field in line (discount code) is empty
--- if the discount code is valid:
---- change [login to view URL]: php3 write current date in the line with the matched discount code as third field. This mark the discount code as obsolete
---- date format: [login to view URL]
---- return true to the calling program as valid discount code and end php3
- leave php1 unchanged
- complete php2:
-- this should the call in php2 look like i.e.:
--- if (php3($discountcode))
--- {
--- // current code for ordering; leave unchanged
--- }
--- else {
--- // new code: error message "discount code invalid"
--- }
Project ID: #3988794
About the project
Awarded to:
20 freelancers are bidding on average $72 for this job
We are experts in PHP Open Source (any kind of PHP/MySQL work), Javascript Framework (Jquery) and Ajax/Web 2.0 technology. Some of the projects we completed for php are mentioned below https://www.freelancer.com/pr More
Hello Hiring Manager, please visit your PMB for more details about my work ,skills and expertise. I have read your given core description of project at our best and will surely give better results.
Hello, I can do this today, if you choose me. Why don't you use a database like mysql or sqlite (simple file, works on any server)? Let's talk and i'll help you optimize your checkout process.
Hi! I can make this validation function quick & deliver high quality. Ready to start right away.
Hi - I'd love to work with you on this - I would like to use jquery/ajax to validate the discount code via a call to a php function- that way the page will not need to be reloaded if the discount code is invalid (whic More
Your instruction and thorough and clear, which I have read and understood perfectly. I am confident about being able to do this. Please See PM for my background.
Sir am highly keen to complete this job within the specified deadline . Bring it on. Thanks..