Jump to content

CroNiX

Staff Alumni
  • Posts

    1,469
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by CroNiX

  1. This may be useful to you: http://davidwalsh.name/browser-camera I believe it's similar to what google hangouts uses to access the camera with HTML5, canvas and javascript.
  2. It depends on what you're testing for. They don't do exactly the same thing. empty() tests for an empty string (like == ''), and a lot more. See the manual.
  3. Because you're trying to access an array element instead of the object. foreach($xml->results as $result) //cycle through results object { //access the properties of this $result object echo $result->name; echo $result->longitute; }
  4. Yes, the OS has control of lastmtime. Whenever something is changed on a filesystem, THAT filesystems OS sets the lastmodtime. So if you upload a file to a server, that servers OS is updating the file on the filesystem so it automatically changes the lastmtime. Perhaps a better way would be to name your files to contain the date of the sermon, and use that as that won't change when uploading. 2015-04-25-sermon-name.mp4 2014-08-25-sermon-name.mp4
  5. Except you probably don't want to cast floats as integers, or 5.5 will be the same as 5.2 (both would be just 5)
  6. You'd do yourself a favor by putting all of your js into a js file instead of using php to construct it.
  7. The best way to address the name issue is to deal with it when the file is UPLOADED. Replace spaces with underscores, remove apostrophes, etc. from the uploaded filename. Then you won't have this issue of having to encode/decode, etc. Personally I'd just use preg_replace and replace anything in the filename that isn't alphanumeric, a period, an underscore or a dash.
  8. Not sure why you'd pass an object via the url where it can be manipulated by the user. Why not serialize the object and store it in a session or something, where the user can't tamper with it?
  9. On your localhost, the url contained RSLU (in caps) and on your server rslu was lower case. Some os's are case sensitive with everything except the domain name.
  10. I hope this isn't a site that will need to be indexed by search engines. They don't execute javascript, or most don't and the ones that do are very limited.
  11. 2 UL's in the same div#navbar. First UL appears on left, 2nd UL appears on right. Both ULs have "nav navbar-nav" classes. The one to appear on the right has an additional "navbar-right" class. <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li class="active"><a href="/">Left Menu</a></li> </ul> <ul class="nav navbar-nav navbar-right"> <li><a href="#">Right Menu</a></li> </ul> </div><!--/.nav-collapse --> I think yours shows on next line because your 2nd UL, the one that's supposed to show on the right, is outside of the div#navbar container.
  12. I don't believe you can the way you have it. You can't use decimal numbers as array keys. If I copy/paste your $kz array and just print_r($kz), you get back whole numbers for the array indices instead of your decimals (24.4 becomes just 24). If your keys were strings containing a decimal, then it could be workable.
  13. This might work: $new_array = array(); while ($row = mysql_fetch_array($db_result)) { //grab the name column from the array $name = $row['name_column']; //unset the name column from the original array unset($row['name_column']; //create a new key using the name column and set the value to the $row $new_array[$name] = $row; } print_r($new_array);
  14. He copied it from your sig, so you might want to update that too
  15. The problem is when you run the function. findNumber($arr); Your function returns a value, but you aren't capturing it. You then try to use it here if ($found == true) { $found does not exist except inside of your function, so anything outside of the function doesn't know anything about it. This is called variable scope and I suggest you read up on it. To fix it, change findNumber($arr); to $found = findNumber($arr);
  16. Look at the previous line. $strNode = $strQuery->item(0)->nodeValue;You are only grabbing the first element's node value, and then you force that to be an array. So it's an array with one value.
  17. var num = 1; num = num.toFixed(2); //2 decimal places console.log(num); //1.00
  18. Also, read up on "successful form controls" for the official explanation in the HTML specs.
  19. To build on what Barand is saying, checkboxes that are not checked do not get sent in a GET/POST request. Only checked checkboxes (and radio selectors). So you need to check to see if it exists in POST/GET, if it does not, set a value like 0 before saving in the database. See Barands link above for an example.
  20. How do you know it was successful? You just return true no matter what. The mail function returns a boolean, you should use that. mail($to,$email_subject,$email_body,$headers); return true; One other thing I noticed, is headers need to be separated with \r\n, not just \n. $headers = "From: whitegatescattery.com\n"; $headers .= "Reply-To: email@gmail.com"; As far as the appending error messages in your second code block, it's probably because you do a var_dump(), which sends that output back to the browser.
  21. FYI, "return" does not send output back to your json request. It only returns to PHP. If you want to send something back to the ajax request, you need to echo something so the output goes back out to the browser.
  22. I don't think the postfields is supposed to be a json string. It should be a querystring Try curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data, '', '&'));
  23. I don't know what the path to the file is. I used what you wrote. Try using a full path
×
×
  • 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.