Jump to content

AngstyG

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

AngstyG's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey, I was wondering if it was possible to build a script that would check an external website (in this case LiveJournal) for updates and email the user when true. Mostly, I'm just focusing on comment tracking, which is something you can pay to have done on LJ, but I'm hoping to sort of bypass that? Ideally, a user would give the script a link to a comment thread, and it would email them when a new comment is posted. Is this even possible? I looked into curl a little, but I'm not sure if it's the right place. Any advice appreciated!
  2. Oh, thanks, Giz! That's actually very helpful. Maybe I can start simple with the SaaS wedding Site, and see where I can go from there. I already sell a lot of wordpress templates, but I suppose it'd be smart to expand to toher CMS's. Thanks for the advice!
  3. I have php auction site scripts, payment gateway scripts, wedding site scripts, etc and so on.
  4. I'm looking into possibly selling some of my PHP scripts. Was just wondering what the profitability for this market is currently like. Anyone out there currently selling their scripts/software? Is it worthwhile? I'm not looking to ~get rich~ or anything, but I'm not sure if I'd go through the trouble for something insignificant, if that makes any sense. Any advice is appreciated!
  5. Ahh, thanks Ken! That definitely did the trick. All 10 emails are now being sent, and all records updated accordingly. I have logged in with each of them and find them to be accurate passwords. However, for any interested parties who comes across this in a search, please note that my use of: $newpass = substr(uniqid(md5(time())), 0, 6); is bad bad bad, as the password is being radomized against the time. And, as you know, all executions take place at the same moment, so the generated key will be the same for each. This is not good. Instead, I used: $newpass = substr(uniqid(md5($name), true), 0, 6); Which uses the username for reference, since it will be unique per every user/loop. HOORAY! Works like a charm! Thanks for the help, guise!
  6. Ok, when I put the email script in, it works great. Loops the full 10 times, emails each person with the randomized MD5 password, etc and so on. JOY! But for some reason, my UPDATE query breaks the loop. It only updates the first row's password and emails only to that user. // Run the shiz if the button is pushed if (isset($_POST['action']) && $_POST['action'] == 'ok') { // Some query to select all users to update $query = mysql_query("SELECT * FROM " . $DBPrefix . "users WHERE Reset=1") or die('There was an error in the query! '.mysql_error()); // Default amount of records being looped is zero, so later we can see if this works $testme = 0; while ($res = mysql_fetch_array($query)) { // Add 1 for each record being correctly looped $testme = $testme + 1; // Gather some information about the user $email = $res['email']; $id = $res['id']; $name = $res['name']; // Generate a new random password for the user $newpass = substr(uniqid(md5(time())), 0, 6); // Update database $query = mysql_query("UPDATE " . $DBPrefix . "users SET password = '" . md5($MD5_PREFIX . $newpass) . "' WHERE id = '$id'") or die('There was an error in the query! '.mysql_error()); // Get super awesome mail function from included file $emailer = new email_class(); // Set yummy template variables omnomnom $emailer->assign_vars(array( 'USERNAME' => $name, 'NEWPASS' => $newpass )); // lol forgot wtf this was even for, but I'm sure it's important... somehow... $emailer->email_uid = $id; // Sendsies! $emailer->email_sender($email, 'newbatchpasswd.inc.php', $MSG['024']); } } It works flawlessly until this code is added: // Update database $query = mysql_query("UPDATE " . $DBPrefix . "users SET password = '" . md5($MD5_PREFIX . $newpass) . "' WHERE id = '$id'") or die('There was an error in the query! '.mysql_error()); I get no mysql errors or anything. It works perfect for the first row. Hmmm. Do I need to nest another loop, or is this just something broken by my method? Thanksya!
  7. Well, this is embarrassing... ("SELECT * " . $DBPrefix . "users WHERE Reset = 1"); ("SELECT * FROM " . $DBPrefix . "users WHERE Reset = 1"); I knew it'd be something ridic obvious.
  8. Ah, yes, it IS an sql error. Huh. I'm not really certain what the issue could be. I even matched the case of the table name, with "R" being upper and "eset" being lower. I'm sure it's something obvious and easy. Isn't is usually? Thanks again for all the help. You're kinda making my whole night. Which doesn't make me lame. At all.
  9. Ahh, thanks for the reply! I've been playing with this for a few hours now, and I'm almost certain I've got the actual stuff (email and update table) within the loop figured out, but I can't seem to get my loop to work. :-\ // Run the shiz if the button is pushed if (isset($_POST['action']) && $_POST['action'] == 'ok') { // some query to select all users to update $query = mysql_query("SELECT * " . $DBPrefix . "users WHERE Reset = 1"); // Default amount of records being looped is zero, so later we can see if this works $testme = 0; while ($result = mysql_fetch_array($query)) { // Add 1 for each record being correctly looped $testme = $testme + 1; } } But even though I have 10 users in the database with "Reset" set to "1", the test "$testme" output always displays 0 (logically, it would display 10). Can any fresh set(s) of eyes spot what's making this loopless? Ahhhh, I'm just now learning loops for php, so forgive my ignorance. On the upside... I have my conditionals down pat. P.S. Thanks for the tip on the setting Reset to 0. Awesome suggestion is awesome.
  10. I'm trying to figure out the best way to email multiple users a new password. My MySQL table looks something like: ID | Name | Password | Email | Reset I'd like to: "UPDATE MyUsersTbl SET password = '" . md5($MD5_PREFIX . $newpass) . "' WHERE Reset = 1"; Or... something like that. And then I'd like it to email the user the new password. I just have no idea where to even begin. I'm familiar with the MD5, which my site uses, but am a native ASP dev, and only just beginning to delve into PHP. Can anyone point me in the right direction? It'd be greatly appreciated.
×
×
  • 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.