Hello everyone...newbie here!!!!

I've downloaded this store locator script from crystaldawn.net called "phpgooglestorelocator" it does what I need it to do and that is search a database of entries I have made. The problem I'm having is when I try to intergrate the phpgooglestorelocator.php file into my existing website by using the code: <? include("zipcodefield.php"); ?> when it calls the file into my existing webpage it throws my tables and overall look of my website out of wack

Any ideas or suggestions???? I've been wrecking my brain for the past few days and can't seem to figure it out.

Any help would be greatly appreciated

Mario

    It's virtually impossible for anyone to help you if you don't post any code! A link to your site would also help.

      Hello,

      Sorry that I did not attach the information that you need in order to help.... below is the php code for the file "phpGooglestorelocator1.php" the website to test what I have so far is www.jmadesigngroup.com/testfolder/index.php

      the index.php has the form field to enter a zipcode as you can see, the results are forwarded to phpGooglestorelocator.php, within this page is the php code "<? include("phpGoogleStoreLocator1.php"); ?>" when a bogus zipcode is entered the structure of my website goes bezerk, if you enter 93257 which is listed in my database the results page stays intact, its only when it can't find a zipcode the results page is thrown out of whack..test yourself and you'll see what I mean..

      Thanks for any help

      the code is more than the allowed characters so you can view the code at: www.jmadesigngroup.com/testfolder/phpcode.txt

        Looking at the html source of the result page, your php script seems to just stop dead after outputting the error message. The closing html tages are basically all missing so giving you an out of whack page. Also there are 2 sets of <html><head></head><body> tags on the page when there should only be one. (There are also 2 set on the index.php page). You should take a look at your code and see why it suddenly stops and also delete the duplicate <head><body> tags.

          ok I checked the code and the code I originally pasted was wrong the corrected code is at:

          www.jmadesigngroup.com/testfolder/phpcode.txt

          this does not have the <head><body> tags and still gives me the results page basket case.... if at all possible could you tell me where to put the closing html tags? or how to fix the results page???? Thanks for you help!!

            The problem is with all the exit function in the phpcode.txt script
            i.e.

            if (!$country)
            {
             echo "Your zipcode does not seem to be valid for the countries that we support.";
             exit;
            }
            

            Basically, whenever the script encounters an error it calls exit which terminates the script (also the page where you included the file).

            You can try delete/comment the exit; and see what you get but you most likely get more errors.

              Thanks for taking the time to look at my problem and I've tried your suggestions but still seem to get the same result, my index.php page where the "enter your zip" field is works fine when a zipcode that I have in my mysql database matches what you enter, the results are displayed in the "phpGooglelocator.php" file without the structure of my website getting out of whack.

              I've tried the suggestions but get the same result in regards to the "exit;" function that terminates the script when an error occurs. Is there anyway to fix this? What I'm trying to accomplish here is I have list of members that are located throughout the US and want to make a locator on mywebsite..I'll enter the list in my database, if a visitor comes to my website and enters their zipcode (say in california) it will display the results for California or within the range of your zipcode.

              I hope someone can help, seems like I've got it to work somewhat except for the results i get when it can not find a zipcode, the error message in my webpage messes everything up.

              thanks,

              Mario

                8 months later

                Hi Mario. I'm trying to install that same script. I was wondering if you had any success? I have the same situation with dealers nationally and want to let people locate the nearest dealer, etc. etc. Please let me know. Thanks!

                  Write a Reply...