smrpgx Posted May 4, 2006 Share Posted May 4, 2006 How do I make it so that every hour, variable $password will change into a random 6-digit number? Quote Link to comment https://forums.phpfreaks.com/topic/9084-time-and-password/ Share on other sites More sharing options...
.josh Posted May 4, 2006 Share Posted May 4, 2006 run this script every hour with a cron job. [code]<?php $newpassword = rand(100000,999999);$conn = @mysql_connect('host','username','pw') or die(mysql_error());$db = @mysql_select_db('database',$conn) or die(mysql_error());$sql = "update tablename set password = '$newpassword' ";$query = mysql_query($sql, $conn) or die(mysql_error());mysql_close($conn);?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/9084-time-and-password/#findComment-33435 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.