-
Posts
1,469 -
Joined
-
Last visited
-
Days Won
12
Posts posted by CroNiX
-
-
define('UPLOAD_DIR', 'images/' .$today. '/');
//Check that the dir exists
if ( ! file_exists(UPLOAD_DIR))
{
//Nope, create it...
mkdir(UPLOAD_DIR);
}
//rest of upload code to move uploaded file to UPLOAD_DIR -
Did you try returning $query->posts() like I suggested?
-
It's not totally necessary, but would help you a lot in understanding what is going on and you'll definitely pick up a OOP framework faster than learning both at the same time.
-
expire column is timestamp value
See how we might be confused?
-
You said it was "timestamp". Timestamp type in mysql is not in seconds. http://dev.mysql.com/doc/refman/5.5/en/datetime.html
The TIMESTAMP data type is used for values that contain both date and time parts. TIMESTAMP has a range of'1970-01-01 00:00:01' UTC to '2038-01-19 03:14:07' UTC. -
If expire is a mysql timestamp, then it's date is in the format yyyy-mm-dd hh:mm:ss. PHP's time() returns a unix timestamp in seconds, like 1411670005.
So this:
if($row['expire'] <= time()){
will never be true because you are saying
if('2014-09-25 11:35:05' <= 1411670005)
so you'd want to compare it to a date in the same format...
if($row['expire'] <= date('Y-m-d H:i:s'){
-
If "student name" is a text field (I assume you mean textarea), then how do you plan on determining the number of students entered into it by the user? It depends on what the user enters...like one name per line (hitting enter after each name), names separated by spaces, names separated by commas. How do you plan on determining how the user entered the student names into that field if it's entirely up to the user?
-
Or if error_message is supposed to be an array, append it.
error_message.push(message.message);
-
Because you are just replacing the old error message with the new one, so it will only show the last one.
Try appending the message...
error_message += message.message;
-
I don't use WP, but you can try this:
function my_sermon_query($meta_key, $meta_value) { $query = new WP_Query( array( 'meta_key' => $meta_key, 'meta_value' => $meta_value, 'post_type' => 'mbsb_sermon' ) ); return $query->posts(); }
-
I've read most of the major distros have updates to fix it. I don't know what's worse...having the actual bug out there for years with few to no one knowing about it or the news telling everyone it exists. Patch fast!
-
1
-
-
Checkboxes will only be transmitted if they are actually checked, so just check to see if it isset().
$checked = isset($_POST['inp_vis']);
-
You are returning the DB object, not the resultset FROM that object.
-
If 2014-08-20 07:32:20 is coming from a datetime/timestamp/date field in a query, you can also get the month from that using SQL and not use PHP.
SELECT MONTH(datetime_field) AS month
http://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html
-
https://developers.google.com/maps/documentation/javascript/geocoding
Then store the lat/lng in the database for future use so you don't have to keep calling the geocoding service for the same address repeatedly. There are limits on how many hits to the geocoding service you can perform/day.
-
Yes, the % is a wild card.
-
1
-
-
I already have the method for getting the coordinates. I just need help with the formula I explained above.
Did you read the first reply from Skunkbad? The 2nd link contains what you're after.
-
Show your new code and post the errors you are getting.
-
See the difference between requinix's process() code and yours as far as the conditional? His does the check within the process() function.
-
Some people need to learn the hard way
Like Home Depot, Target, and other huge stores being lax with security? (Or...ignoring them when employees brought it up)
-
Personally I'd use a js alert() method to display the cancellation policy, or some other javascript modal/overlay. If their browsers settings are blocking popups (most do) they will never see the cancellation policy since it's trying to open a new tab.
-
1
-
-
Did you check the server logs? I see a syntax error where you are creating the links (missing closing ]):
urlencode($data[$j)
-
What version of jQuery?
-
javascript+ajax. Using jQuery, it would be as simple as when a form element blurs, use $(form).serialize() and send the data via POST using ajax to a url that would save it.
What am I doing wrong? Sending variables to PHP
in Javascript Help
Posted
How do you know it's not sending anything? Your local_settings.php script doesn't return anything back to the ajax, so data does not contain anything in your success() method. It just sets Session vars on the server.