boompa
Members-
Posts
305 -
Joined
-
Last visited
-
Days Won
1
Everything posted by boompa
-
Undefined index: min in /phpvalidation.php on line 100
boompa replied to ephbaum's topic in PHP Coding Help
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. -
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"); ?>
-
The hash_hmac function. There's a full example right on the page! http://docs.cointrader.apiary.io/#authenticatedmethodspost
-
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; ?>
-
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.
-
That sure looks like bash script to me, not PHP.
-
Relatively secure server to server communication
boompa replied to NotionCommotion's topic in PHP Coding Help
True, iptables would be fine. As someone who works with virtualization, I tend to think of even iptables as "hardware" -
Relatively secure server to server communication
boompa replied to NotionCommotion's topic in PHP Coding Help
This should be enforced at the hardware level, i.e. via firewall. -
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.
-
Make sure there's absolutely no output before the <?php. Even if it's a blank line.
-
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.
-
Read the documentation
-
<option name="country" value=<? echo $countryOptions;?>Country</option> That should be a select element, not an option.
-
Because that's what you're telling it to do here: echo json_encode($array); Maybe you wanted that in an else block?
-
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.
-
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')
-
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.
-
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 } ] } ] }
-
OK, now go read this: http://securephpwiki.com/index.php/Email_Injection And consider moving to a library like PHPmailer or SwiftMailer.
-
Given this: , why not simplify by doing the following: 1. DELETE all records from the database. 2. INSERT new records based on the JSON.
-
Using the PHP SoapClient instead of doing XML parsing?
-
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?
-
NodeJS + socket.io + PHP to achieve real-time notifications
boompa replied to JasonLewis's topic in Javascript Help
Could try this: http://socketo.me/