I have a weird problem. I have a simple function to open a popup with information about a pin (by clicking on a link with that PIN)
It works fine for some pins, but converts others to a different number.
For example passing '033604' opens http://mysite.com/pincheck.php?pin=014212
but passing '023960' opens http://mysite.com/pincheck.php?pin=023960 (what I need)
Passing '032765' opens http://mysite.com/pincheck.php?pin=013813
but passing '030309' opens http://mysite.com/pincheck.php?pin=030309 (what I need)
I've tried a bunch of pins and it's all random like that - either passes the correct pin or converts it to a different number
The function is
function win_open_pin(pin) {
newwindow = window.open('pincheck.php?pin=' + '0' + pin + '' , 'popupwin', 'menubar=no,history=no,resizable=yes,scrollbars=yes,toolbar=no,width=650,height=300');
if (window.focus) {newwindow.focus()}
}
I did try using pincheck.php?pin=0' + pin and did try pin = toString(pin) in the function - no use
The call is also simple
<a href=\"javascript:win_open_pin($pin)\">$pin</a>
The $pin variable in php is taken from the db and is a string, I even did (string) casting just in case. It seems to be js issue, as I never had issues like that with php.
I don't see any rhyme or reason to this. Hope someone can point me in the right direction to solve this. Thanks.