schilly
Members-
Posts
870 -
Joined
-
Last visited
Never
Everything posted by schilly
-
fire off email when database has entry (w/ PHP)
schilly replied to webguync's topic in PHP Coding Help
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. -
fire off email when database has entry (w/ PHP)
schilly replied to webguync's topic in PHP Coding Help
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. -
fire off email when database has entry (w/ PHP)
schilly replied to webguync's topic in PHP Coding Help
you need a php script to do the work. the cron is just the timer that triggers the sciprt. -
Article Hit Counter - Most Efficient Method
schilly replied to XGCommander's topic in PHP Coding Help
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. -
fire off email when database has entry (w/ PHP)
schilly replied to webguync's topic in PHP Coding Help
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. -
can anyone tell me whats wrong with my query?
schilly replied to Greysoul's topic in PHP Coding Help
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()); -
your best bet is probably the WP forums.
-
Article Hit Counter - Most Efficient Method
schilly replied to XGCommander's topic in PHP Coding Help
i dunno. i can't think of any other way to do it. -
fire off email when database has entry (w/ PHP)
schilly replied to webguync's topic in PHP Coding Help
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 -
PHP if then with a variable in an HTML table
schilly replied to newnewbie's topic in PHP Coding Help
you can look at the php manual for assignment operators. http://www.php.net/manual/en/language.operators.php -
Article Hit Counter - Most Efficient Method
schilly replied to XGCommander's topic in PHP Coding Help
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. -
fire off email when database has entry (w/ PHP)
schilly replied to webguync's topic in PHP Coding Help
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. -
PHP if then with a variable in an HTML table
schilly replied to newnewbie's topic in PHP Coding Help
you want to do $page_title = "My Stories"; = is for assignment. == is for comparison. -
that looks fine to me. make sure your query is actually returning the authlevel column.
-
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";
-
Article Hit Counter - Most Efficient Method
schilly replied to XGCommander's topic in PHP Coding Help
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? -
Not sure why login form isn't working w/ JQuery
schilly replied to webguync's topic in PHP Coding Help
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. -
Not sure why login form isn't working w/ JQuery
schilly replied to webguync's topic in PHP Coding Help
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. -
Not sure why login form isn't working w/ JQuery
schilly replied to webguync's topic in PHP Coding Help
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. -
Failed to open stream: No such file or directory in error
schilly replied to gilgimech's topic in PHP Coding Help
you can still have an include with all your css links in it. -
Not sure why login form isn't working w/ JQuery
schilly replied to webguync's topic in PHP Coding Help
well you md5()'d the password so it should be scrambled. -
Failed to open stream: No such file or directory in error
schilly replied to gilgimech's topic in PHP Coding Help
why is news_body.php trying to include css.php? you've already included it in the top of your file. -
Excluding Weekends in a dropdown box of dates
schilly replied to ShopMAster's topic in PHP Coding Help
=) np. -
Excluding Weekends in a dropdown box of dates
schilly replied to ShopMAster's topic in PHP Coding Help
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. -
Not sure why login form isn't working w/ JQuery
schilly replied to webguync's topic in PHP Coding Help
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.