Jump to content

zamight

New Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by zamight

  1. I use PSR-2. So I would break a new line for a function curly bracket.
  2. I don't know the host's code. Since the form submits via POST and your only passing two parts of the form when there are three. Including the button which is name="Submit" and value="Login" this could pose a problem from the host if they check for the value of the button. This is just a guess. I don't really use curl to login websites.
  3. Currently, way your code is the setup you can only access the $message array inside the scope of your while loop. Anything else trying to access the $message array outside the scope of the while loop will be null.
  4. After switching to a vps my file will not write to the img anymore. the php code. It does make the img but doesn't write the number. It did work previously on other server. <?php $imageURL = $_GET['imageURL']; if($imageURL == "money"){ $im = imagecreatefrompng("images/gp.png"); }else { $imageURL = str_replace(" ", "%20", $imageURL); $ch = curl_init(); $timeout = 5; curl_setopt($ch, CURLOPT_URL, $imageURL); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $data = curl_exec($ch); curl_close($ch); $im = imagecreatefromstring($data); } $quantity = $_GET['quantity']; if($quantity > 1 OR isset($_GET['displayNum'])){ //Fixed the amount display, was a bug I found if the quantity was 10m+ if($quantity < 100000){ $color = imagecolorallocate($im, 255, 255, 0); $suffix = ''; }else if($quantity < 10000000){ $color = imagecolorallocate($im, 255, 255, 255); $quantity = floor($quantity / 1000); $suffix = 'K'; }else { $color = imagecolorallocate($im, 0, 255, 0); $quantity = floor($quantity / 1000000); $suffix = 'M'; } imagettftext($im, 8, 0, 8, 13, $color, 'arial.ttf', number_format($quantity) . $suffix); } header('Content-type: image/png'); imagepng($im); imagedestroy($im); ?> Thanks if you guys can help!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.