Code Breaking on Refresh

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Nick11380
Forum Newbie
Posts: 10
Joined: Sat Aug 20, 2011 10:20 am

Code Breaking on Refresh

Post 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?
Dodon
Forum Commoner
Posts: 64
Joined: Wed Aug 03, 2011 4:11 am
Location: Netherlands

Re: Code Breaking on Refresh

Post 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?
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: Code Breaking on Refresh

Post 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)
Nick11380
Forum Newbie
Posts: 10
Joined: Sat Aug 20, 2011 10:20 am

Re: Code Breaking on Refresh

Post 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.
Post Reply