Jump to content

schilly

Members
  • Posts

    870
  • Joined

  • Last visited

    Never

Everything posted by schilly

  1. i leave all the validation up to the credit card merchant through payment processing APIs.
  2. you can just compare against the array instead of all those nested if statements. if (!in_array($r[topic_id],$used_ids))
  3. because you have nested for loops you $page array is looping through every $title value, hence getting 3x the output. if you only have a 1-1 relationship (one page per title and vice versa) on your values just do: for($i =0; $i < count($page); $i++){ echo "<a href=\"".$page[$i]."\">".$title[$i]."</a><br>"; } other option would be to combine those two arrays.
  4. thanks dreamwest. so you didn't tweak any of the database config? I'm guessing we probably have some old queries lying around but most of the frontend code has been revamped in the last 6 months. I have looked at the slow-queries log but most of from backend statistics queries that don't get run very often.
  5. This should work too $sql = "UPDATE message SET status = 'new' WHERE post_time >= DATE_SUB(NOW(), INTERVAL 30 MINUTE) "; Did you try a select to see if it matched any rows?
  6. try this $sql = "UPDATE message SET status = 'new' WHERE post_time >= FROM_UNIXTIME(" . time() - 60*30 . ") "; there should be a way directly in mysql but i'm not totally sure on the syntax. you can look at the date/time f'ns in mysql here: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html
  7. well either way, (attachment or links) they could forward the email to someone and they could access the pdfs. i would stay away from attachments. the emails could get too big and there is also the possibility of stressing the mail server (depending on traffic). if you are really concerned about capturing the email address, you may need an account system and they would need to login to download the pdfs. The other option is to set some kind of timestamp hash and add that to the download link. use a php download script which then checks the timestamp hash and if it's within a certain time period, have it send the file for downloading else say the link has expired.
  8. what's the data type of post_time in that table?
  9. Try this example and email yourself to see if it works. <?php $to = "yourplace@somewhere.com"; $subject = "My email test."; $message = "Hello, how are you?"; $headers = "From: myplace@here.com\r\n"; if ( mail($to,$subject,$message,$headers) ) { echo "The email has been sent!"; } else { echo "The email has failed!"; } ?>
  10. If the headers aren't set or set up properly the from address will default to the unix php user account (ex phpuser) @ server_name (usually an internal name for most hosting) your code looks good though. add the carriage on that last line. it could be messing up the default headers when the custom headers are added in. $headers = 'From: applications@mydomain.com' . "\r\n" . 'Reply-To: applications@mydomain.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n";
  11. most mysql configs have external db connections turned off by default.
  12. wow. you can definitely shorten that down. you're still limited by unix timestamp constraints using that code so I don't see why you don't just do it in mysql. use UNIX_TIMESTAMP to convert the value from the db in your query. if you need the mysql datestamp for something else just pull both values. if($db_unix_time < (time() - 86400)) return true; else return false;
  13. $query="SELECT * FROM MyNotes ORDER BY id DESC";
  14. I see the limitations but your still converting the mysql date to a unix timestamp in that code. whats the difference if you do it in mysql or php?
  15. Sorry. What are the limitations? Nothing previous to 1970? You can get the UNIX_TIMESTAMP in addition to the standard MYSQL TIMESTAMP in your query.
  16. if you do UNIX_TIMESTAMP(db_date_column) in your query you can turn the date value into a unix timestamp. then check that against time() - 60*60*24 (24 hrs ago)
  17. just debug that $email variable when the supervisor1 is set and you should be fine.
  18. echo $email and $message right before the mail fn is called. It sounds like $email is not being set properly and the mail fn craps out because it is not a valid address.
  19. Ok. node->field_spaces[] = array('nid' => $nid); I think that should do it.
×
×
  • 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.