Jump to content

boompa

Members
  • Posts

    305
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by boompa

  1. You should use var_dump on the contents of $opt, which should demonstrate that at least the "min" key is not set. Without knowing how that array is populated, we can't tell you more than that PHP is not lying to you about the "min" key being unset.
  2. The "complex" page has no PHP code in it at all; it is strictly HTML. Problem with this: <?php include 'navigation.php'; ?> <? include ("footer-1.php"); ?> is likely the use of short tags. Try this instead: <?php include 'navigation.php'; ?> <?php include ("footer-1.php"); ?>
  3. The hash_hmac function. There's a full example right on the page! http://docs.cointrader.apiary.io/#authenticatedmethodspost
  4. I'm not sure why you're trying to use XML, as the API docs indicate you should be using JSON. Something like this: <?php $request = array( 'method' => "account_currencies", 'params' => array('account' => "gM4Fpv2QuHY4knJsQyYGKEHFGw3eMBwc1U") ); $ch = curl_init(); $headers[] = "Content-Type: application/json"; $headers[] = "Content-length: ".strlen($request) . "\r\n"; curl_setopt($ch, CURLOPT_URL, "https://test.stellar.org"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_PORT , 9002); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($request)); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers ); $response = curl_exec($ch); curl_close($ch); echo $response; ?>
  5. If you're going to use WinHTTP, you're likely going to have to assemble a multipart MIME message to send a file. See here or RFC 1867 for how to do this.
  6. That sure looks like bash script to me, not PHP.
  7. True, iptables would be fine. As someone who works with virtualization, I tend to think of even iptables as "hardware"
  8. This should be enforced at the hardware level, i.e. via firewall.
  9. You should place a exit() call immediately after header(), otherwise the rest of the script continues processing. Also, md5 is not encryption, nor is it safe. Please read this: http://jeremykendall.net/2014/01/04/php-password-hashing-a-dead-simple-implementation/ And you should not be using the mysql functions -- they will being going away in a future version of PHP -- but rather using mysqli or PDO along with prepared statements.
  10. Make sure there's absolutely no output before the <?php. Even if it's a blank line.
  11. First off, use code tags when you post code. Highlight your code and press the < > button. This is one of the most frequently asked questions in PHP, and as such is in the PHP Resources and FAQs topic pinned at the top of the forum. You can't have any output before a session_start or header function call. Move your doctype declaration (it should be <!doctype html>) to after the PHP block, right before the <html> tag.
  12. Read the documentation
  13. <option name="country" value=<? echo $countryOptions;?>Country</option> That should be a select element, not an option.
  14. Because that's what you're telling it to do here: echo json_encode($array); Maybe you wanted that in an else block?
  15. In queries it's single quotes around non-numeric values, backticks around column names. In any event, you need to look into prepared statements before you get hacked.
  16. Spend some time learning how to debug JavaScript in the browser: Generic: http://juliepagano.com/blog/2014/05/18/javascript-debugging-for-beginners/ Chrome: https://developer.chrome.com/devtools/docs/javascript-debugging Firefox: https://developer.mozilla.org/en-US/docs/Debugging_JavaScript Then, check the value of dataString to see if it's a valid query string.
  17. You don't say *how* your "if condition doesn't works", but this is assigning the value 'Yes' to $req, not comparing it: ($req='Yes')
  18. I don't know how you're not getting an error, considering there is no $beer variable where you copied and pasted the provided code. *Think* about what you're doing here. You want to check the logo url *for each* beer in the list, right? Oh, and you probably want to fix your gif so that EXCLUSIVE is spelled properly.
  19. Building your example data: <?php $data = array(); $cols = array(); array_push($cols, array("id" => "", "label" => "Topping", "type" => "string")); array_push($cols, array("id" => "", "label" => "Slices", "type" => "number")); $data['cols'] = $cols; $toppings = array('mushrooms' => 3, 'Onions' => 1, 'Olives' => 1, 'Zucchini' => 1, 'Pepperoni' => 2); $rows = array(); foreach($toppings as $topping => $quantity) { $elements = array(); array_push($elements, array("v" => $topping, "f" => null)); array_push($elements, array("v" => $quantity, "f" => null)); $row = array("c" => $elements); array_push($rows, $row); } $data['rows'] = $rows; echo json_encode($data, JSON_PRETTY_PRINT); { "cols": [ { "id": "", "label": "Topping", "type": "string" }, { "id": "", "label": "Slices", "type": "number" } ], "rows": [ { "c": [ { "v": "mushrooms", "f": null }, { "v": 3, "f": null } ] }, { "c": [ { "v": "Onions", "f": null }, { "v": 1, "f": null } ] }, { "c": [ { "v": "Olives", "f": null }, { "v": 1, "f": null } ] }, { "c": [ { "v": "Zucchini", "f": null }, { "v": 1, "f": null } ] }, { "c": [ { "v": "Pepperoni", "f": null }, { "v": 2, "f": null } ] } ] }
  20. OK, now go read this: http://securephpwiki.com/index.php/Email_Injection And consider moving to a library like PHPmailer or SwiftMailer.
  21. Given this: , why not simplify by doing the following: 1. DELETE all records from the database. 2. INSERT new records based on the JSON.
  22. Using the PHP SoapClient instead of doing XML parsing?
  23. Ah, well I just noticed this: $video = isset($_FILES['video']); $videoname = isset($_FILES['video']['name']); $videotmp = isset($_FILES['video']['tmp_name']); $videosize = isset($_FILES['video']['size']); $videotype = isset($_FILES['video']['type']); Do you realize that isset() simply returns true or false?
  24. And what do you find if you do this? $errors[] = "The file type $videotype is not allowed, only allowed .mp4, .ogg and .mov";
  25. Could try this: http://socketo.me/
×
×
  • 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.