Forums

How can I use CF to check against known data and then...

Jabejo22 30 Apr, 2009
Hi,

I have a product that I want to be able to restrict the purchase to only 2 people per zip code. What I want to do is have a page where users can input their zip code and then depending one whether the 2 slots have been filled or not they would be direct either to a page that says, "It's available" or to a page that says "to late" or something like that... you get the idea.

All the page would have on it is a field to input the zip and then a submit button. I don't know what to do beyond that to make it search for zip codes that are available and then return an accurate message. I'm a noob so talk to me like a 6 year old, it's okay.


Thanks for your help.
Max_admin 30 Apr, 2009
Hi Jabejo22,

you can do this easily as long as you have the code to check the zip codes, just add it to the onSubmit bow and redirect the user if true using :


global $mainframe;
$mainframe->redirect('some link here');


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Jabejo22 30 Apr, 2009
...as long as you have the code to check the zip codes.

when you say "code" are you talking about the HTML code? If so, how would I get that and then how would that work? In other words, when someone orders, that zip code would have to be removed, how do I do that on someone else's site?

Do I have to have my own database of zip codes? Is that what you're saying?

I'm lost...
Max_admin 03 May, 2009
Hi Jabejo22,

its like this, you save all your forms data, and when a new submission is made, you write some PHP code to check, do we have 2 records with this zip ? if yes then redirect to a "you are too late" page, if not then submit the form and show the thank you or whatever!

Cheers,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.