budfox Posted January 29, 2010 Share Posted January 29, 2010 Hello everyone. I'm a bit of a PHP newbie I'm afraid. My experience is limited to slightly modifying existing code, such as in Joomla, to make small changes. I have no real idea how to write a piece of code from scratch and unfortunately, I need to. For my own satisfaction, I'd rather do it myself, learning as I go, with just a few pointers to get things started. I need to do the following: On my page (which happens to be a Zen Cart store) I need a box where someone types their UK postcode. I'm going to simplify the next bit so that my explanation is easier. Once the script has got the postcode, it checks against a list of postcodes that we deliver to, and then either prints: 'yes we deliver to your area' if it finds a match. If not is says 'sorry, we don't deliver' So in summary this is what happens: User inputs postcode and hits a 'check' button. PHP checks to see if the postcode is on the list. If it is, we get a 'yes' message. If it isn't, we get a 'no' message. I don't want the page to reload, just the answer to appear underneath the input box. In reality, there are three delivery zones, and I want 'yes we deliver and it will cost £x.xx to deliver to your area' but I'll work that out. Thanks for any help Steve Quote Link to comment Share on other sites More sharing options...
schilly Posted January 29, 2010 Share Posted January 29, 2010 well if you don't want the page to reload you'll have to look into AJAX. basically a form with one field and a submit button. use ajax to submit the form to your php script that checks the postal code and returns yes or no. Quote Link to comment 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.