-
Posts
1,469 -
Joined
-
Last visited
-
Days Won
12
Everything posted by CroNiX
-
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.
-
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.
-
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; }
-
Good luck with that attitude!
-
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
-
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)
-
Replacing a select drop down with images in php
CroNiX replied to totallytech's topic in PHP Coding Help
You'd do yourself a favor by putting all of your js into a js file instead of using php to construct it. -
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.
-
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?
-
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.
-
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.
-
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.
-
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.
-
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);
-
He copied it from your sig, so you might want to update that too
-
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);
-
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.
-
var num = 1; num = num.toFixed(2); //2 decimal places console.log(num); //1.00
-
Also, read up on "successful form controls" for the official explanation in the HTML specs.
-
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.
-
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.
-
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.
-
"Headers or JSON POST missing tonce, corrupt or incomplete"
CroNiX replied to peterhuynh's topic in PHP Coding Help
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, '', '&'));