Jump to content

schilly

Members
  • Posts

    870
  • Joined

  • Last visited

    Never

Everything posted by schilly

  1. if($result) { mail('user@domain.com','subject','body'); $replySQL = "SELECT log_id FROM og_March2010 WHERE user_id=$userID"; $kickback = $db->query($replySQL); $kickback->get_rows(); $row = $kickback->fetch_assoc(); $logID = $row['log_id']; $db->close(); echo 'triumph=sieg&logid='.$logID; } /php] you can put $userID,$sect,$time,$attempt in a string if you want to include them in the body of the email.
  2. so you'd likely be doing this via a form post when you update the record. if($_POST['submitButton']){ //validate post data here //run update query. value and id are from your $_POST data $sql = "UPDATE table set value = '$value' WHERE id = $id"; mysql_query($sql); //check value to see if it meets our threshold if($value == 1){ mail('email@domain.com, email2@domain.com','subject','body'); } } something like that.
  3. you need a php script to do the work. the cron is just the timer that triggers the sciprt.
  4. isn't the query pretty basic already? update articles set count = count+1 where article_id = $id I'd say run an ajax call to a db query so it doesn't slow down the page load time for the user.
  5. you'll have to check with your web server to see if they allow for crons to be set up. it's basically a daemon that runs on your web server where you can set triggers to go off after certain time intervals (minute, hour, day, month, etc). In this case, it would trigger a PHP script which would select all the rows from your db where value = 1 then send off an email to your group.
  6. are you getting an error? $score=mysql_query("SELECT *, COUNT(Player) AS gp, SUM(Score) AS score, (score/gp) AS spg FROM Scorecard WHERE score > 0 GROUP BY Player ORDER BY spg DESC Limit 0,10") or die(mysql_error());
  7. your best bet is probably the WP forums.
  8. i dunno. i can't think of any other way to do it.
  9. there is a couple ways. -either when you do an update statement check to see if the value is set to one and if it is send out the email. -set up a cron to automatically check the database after a certain period of time and send out emails for every record it finds with value = 1
  10. you can look at the php manual for assignment operators. http://www.php.net/manual/en/language.operators.php
  11. found this if you want to try the file method: http://stackoverflow.com/questions/293601/php-and-concurrent-file-access Call it via ajax after the page loads then if it can't lock the file repeat after a second or so until it can write out the page view. it might work.
  12. yea it's pretty easy. read up on the mail function: www.php.net/manual/en/function.mail.php so when you update data in whatever table it is, check for the value you want then use mail() to email the people required.
  13. you want to do $page_title = "My Stories"; = is for assignment. == is for comparison.
  14. that looks fine to me. make sure your query is actually returning the authlevel column.
  15. well you could store the user level in your session when you login then you wouldn't need to query the db. then you can do something like: if ($_SESSION['authlevel']>4) echo "adminpanel";
  16. what would happen when more than one person tries to update the local file? would they be able to open it if someone else has it open in write mode already? I'm not sure about concurrency when writing to file but it seems like this would be a problem. The database on the other hand would handle this no prob and being that the page is cached, only the counter query would run which shouldn't tax you too much?
  17. yup. you can remove the md5 from the login page if you want but you really should change all your passwords to be stored as a hash.
  18. when you add a user to your users db table just md5() the password. then when you login md5 the posted password and it should match the one in the database.
  19. you should really be storing your passwords as some kind of hash in the db so if someone hacks your db they can't see what the passwords are.
  20. you can still have an include with all your css links in it.
  21. well you md5()'d the password so it should be scrambled.
  22. why is news_body.php trying to include css.php? you've already included it in the top of your file.
  23. prolly easier to do in a while for this: $i = 0; $num_days = 0; while( $num_days < 15 ){ if(date('D',mktime(0,0,0,$m,($de-$i),$y)) != "Sat" && date('D',mktime(0,0,0,$m,($de-$i),$y)) != "Sun"){ echo "<option value=daytest.php?dateselect=" . date('mdy',mktime(0,0,0,$m,($de-$i),$y)) . "&day=" . date('F d, Y',mktime(0,0,0,$m,($de-$i),$y)) . "'>" . date('D, F d, Y',mktime(0,0,0,$m,($de-$i),$y)) . "</option>"; $num_days++; } $i++; } something like that.
  24. so in your php script just do something like this after you sql call: $sql= "SELECT * FROM roster_March2010 WHERE username = '$username' AND pwid = '$password'"; $query = mysql_query($sql); $num_rows = mysql_num_rows($query); mail("email@domain.com","ajax debug","$sql\n\n mysql num rows = $num_rows"); now you should get an email of the query it ran and the number of rows it returned. with this you can test it yourself on your database to make sure it actually returns a result.
×
×
  • 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.