Jump to content

PaulRyan

Members
  • Posts

    876
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by PaulRyan

  1.  

    <?php
      $c = curl_init();
              curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
              curl_setopt($c, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json'));
              curl_setopt($c, CURLOPT_URL, 'http://data.mtgox.com/api/2/BTCUSD/money/ticker');
     
      $content = curl_exec($c);
      curl_close($c);
     
      $api = json_decode($content, TRUE);
     
     
      return print_r($api['data']['avg'], TRUE);
     
    ?>
  2. The code you want to have on your page should definitely go above the header.php include part.

    This is to keep all processing above any output to the browser.

     

    Place this code above the header include, but below init.php include.

     

     

      echo '<pre>';
      print_r($_POST);
      echo '</pre>';
    

     

    Then check the output of that before and after form submission.

  3. I tried that but none of it helped.

     

    Are you sure? I can spot quite a few things that will output some errors for you to see.

     

    If the error reporting really did nothing, then you need to next debug your code, to see what is going wrong and where.

     

    I would display all the $_POST data on form submission, to make sure it is what you expect.

    Then I would debug your query, to make sure it is what you expect and also check for query errors too.

  4. I think you'll find I do understand PHP, you just don't understand English fully.

     

    He first has to upload the image, via a form (He doesn't have a problem with this, otherwise he'd have said so)

    Secondly, he wants to re-size any image that is above 1,500px, so it will work with his image slideshow (This is where he is stuck)

     

    You also don't understand JavaScript, you can't re-size an image using JavaScript. You can make it look smaller, but you can't physically change it's dimensions.

    You need to use PHP to find the ratio of how to scale the image, then save the image in the correct dimensions (All done by PHP)

×
×
  • 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.