Jump to content

Some help for a newbie please - just some pointers to get started.


budfox

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.