Closed mylesagray closed 10 years ago
use 000000
It works now as I added a hex to decimal converter as advised on StackOverflow: http://stackoverflow.com/questions/20241735/cannot-set-specific-param-from-get/
Hi, I was having the same Problem and at the end I get the parameter like this:
$backColor = (isset($_GET['backColor']))? hexdec($_GET['backColor']) : 0xFFFFFF;
I have used the lib to create a parameterised PHP page that we can generate QR codes from the params in the url:
This works perfectly for
url
,err
,size
andpixel
but as soon as I try and set the colours from the URL - the respective colour change (fg or bg) just defaults to black.However, if the variables
$fore_color
or$back_color
are set explicitly (not through the URL and use theelse
statement then they work. (I should note that if you look at the above they will default to black FG and white BG if the param isn't set).I have echo'd out the
$fore_color
and$back_color
to check the values are being passed correctly and they are showing up exactly as expected - this behaviour occurs when one or both of the color params are populated in the URL.I set up a few examples here:
http://rd.exitex.com/qr.php?url=test&size=40&pixel=1&err=L&bg=0xFFFFFF&fg=0x000000
http://rd.exitex.com/qr.php?url=test&size=40&pixel=1&err=L&bg=0xFFFFFF
http://rd.exitex.com/qr.php?url=test&size=40&pixel=1&err=L&fg=0x000000
http://rd.exitex.com/qr.php?url=test&size=40&pixel=1&err=L
Any advice as to this strange behaviour please advise.