Page 1 of 1

Code Breaking on Refresh

Posted: Fri Sep 09, 2011 2:14 am
by Nick11380
Hi all,

The problem I am having is bizarre. The PHP code on both of these pages displays the gold price in grams and ounces.

http://www.goldprices.org.uk/gold-1/
http://www.goldspotprice.org.uk/gold-2/

/gold-2 works perfectly. /gold-1 breaks when the page is refreshed.

As I say, the code is absolutely identical on both pages, however one domain breaks the code and the other does not seem to break the code.

Does anyone have a clue what is happening here?

Re: Code Breaking on Refresh

Posted: Fri Sep 09, 2011 2:58 am
by Dodon
I refreshed the page 10 times and no crash, what is it that stops working? is it the form? or just some error?

Re: Code Breaking on Refresh

Posted: Fri Sep 09, 2011 3:00 am
by twinedev
If they are the same exact code on both sites for sure, then my guess would be that where you are going to retrieve the gold prices from are not allowing a connection from the first sites IP (79.170.44.118) but allowing it from the second (79.170.40.54). Perhaps you have been testing the code like crazy on the first site, and by now they have blocked requests from that IP. (Have had that happened with things before).

Debugging, go to the code where it is making a call to the feed, verify that you are getting expected results from the feed.

-Greg

BTW, on the first page, from first time I went there the price was missing, so probably your browser was showing cashed copy with price, then you refreshed and it looked like then it broke. (yet it was really broke to begin with, well since it stopped working)

Re: Code Breaking on Refresh

Posted: Fri Sep 09, 2011 3:08 am
by Nick11380
Thanks for the responses. I really hope it isn't the i.p but I think you're probably right...

Hopefully I can get this resolved.