skybird Posted January 18, 2013 Share Posted January 18, 2013 Hi, I need your help in distance.php script. When $zip = 64154 (original zip code from Larry), the firefox browser screen shows: Nearest stores to 64154: with 3 complete store info. However, when $zip = other postcodes like: $zip= 02062 (Norwood, MA) the screen reads: Nearest stores to 1074: with 3 complete store info. My question: How to stop the postcode change on my webpage? operating system: win7 editor: dreamweave xampp1.7.3 php 5.3.1 mysql 5.1.41 Looking forward to your help. Link to comment Share on other sites More sharing options...
margaux Posted January 18, 2013 Share Posted January 18, 2013 It looks like your $zip variable is cast as an integer. You need to convert it to a string - there are several ways to do so, one way is to cast it using string 1 Link to comment Share on other sites More sharing options...
skybird Posted January 18, 2013 Author Share Posted January 18, 2013 Thank you very much for your help. Margaux. Following Larry's book instruction on distance.php script, I put the post code in quotes, And It's set.!!! Have a wonderful weekend. Link to comment Share on other sites More sharing options...
margaux Posted January 18, 2013 Share Posted January 18, 2013 Glad I was able to help. As you start to write your own functions you will find that you need to manipulate the variable type so its a useful lesson. The php manual is a good resource for manipulating and casting types. Link to comment Share on other sites More sharing options...
Recommended Posts