Jump to content

enemeth

Members
  • Posts

    60
  • Joined

  • Last visited

Everything posted by enemeth

  1. Hi there got this problem with the log out script, can someone tell me what i am doing wrong? <?php // This blurb starts the session for the users. session_start(); header("Cache-control: private"); // Fix for ie6 ?> <?php $msg = "Please Log In!"; ?> <?php if(!isset($_SESSION['username'])) { echo("<meta http-equiv='Refresh' content='0; URL=../login.php'/>"); echo ("<script langauge=\"javascript\">alert(\"".$msg."\");</script>"); } else { ?> <?php include("headermem.php"); ?> <center><font color=white> Are you sure you want to logout?</font></center><br> <center><a href=/index.php>Yes</a> | <?php unset($_SESSION['username']); ?> <a href=javascript:history.back()>No</a>"; <?php include 'footermem.php'; ?> <? } ?> i guess you guys can see it right off the bat ! but i guess i am blind but everytime you go to the page it logs you out no matter what your choice is Thank you Elaine
  2. yup i got it , working great now Thank you Elaine
  3. Got it ! it was the scope value Thanks Elaine
  4. this is the lostpw.php page <?php include 'db.php'; $msg = "You forgot to enter your Email address"; $msga = "No records found matching your email address"; $msgb = "Your password has been sent. Please check your email."; switch($_POST['recover']){ default: include 'lostpsw.php'; break; case "recover": recover_pw($_POST['email_address']); break; } function makeRandomPassword() { $salt = "abchefghjkmnpqrstuvwxyz0123456789"; srand((double)microtime()*1000000); $i = 0; while ($i <= 7) { $num = rand() % 33; $tmp = substr($salt, $num, 1); $pass = $pass . $tmp; $i++; } return $pass; } function recover_pw($email_address){ if(!$email_address){ echo "<script langauge=\"javascript\">alert(\"".$msga."\");</script>"; include 'lostpsw.php'; exit(); } $sql_check = mysql_query("SELECT * FROM users WHERE email_address='$email_address'"); $sql_check_num = mysql_num_rows($sql_check); if($sql_check_num == 0){ echo "<script langauge=\"javascript\">alert(\"".$msga."\");</script>"; include 'lostpsw.php'; exit(); } $random_password = makeRandomPassword(); $db_password = md5($random_password); $sql = mysql_query("UPDATE users SET password='$db_password' WHERE email_address='$email_address'"); $subject = "Your Password at The Truth Discovered!"; $message = "Hi, we have reset your password. New Password: $random_password http://www.thetruthdiscovered.com/login.php Thanks! The Webmaster This is an automated response, please do not reply!"; mail($email_address, $subject, $message, "From: The Truth Discovered Webmaster<[email protected]>\n X-Mailer: PHP/" . phpversion()); echo "<script langauge=\"javascript\">alert(\"".$msgb."\");</script>"; include 'login.php'; } ?> no calling any other pages with this Elaine
  5. yes there both in the same directory one is checkuser.php and the other is lostpw.php Elaine
  6. I dont no if this is considered a PHP issue or a JAVA issue but on my site i have pop up boxes to notify people if they do not enter certain information in the fields, etc... and it works great on checkuser.php , but i created the forgot password page , which is a whole other story put the exact code from the checkuser.php file to the new file , and i mean i checked it with a fine tooth comb to make sure it was exact and it works and all the pop up box comes up lovely! but with no words in it LOL i dont no what it is and variables are set for what the popup box should say its flawless ! is there a known issue about the words not showing up on the pop up boxes sometimes, cause i go back to the other pages that have them and see the message just fine so i no it isnt my browser Help Thanks , Elaine
  7. and are the exclamation marks REALLY that overbearing LOL !! come on now , just need some help on the pop up Elaine
  8. here is the code <?php include 'db.php'; $msg = "You forgot to enter your Email address"; $msga = "No records found matching your email address"; $msgb = "Your password has been sent! Please check your email!"; switch($_POST['recover']){ default: include 'lostpsw.php'; break; case "recover": recover_pw($_POST['email_address']); break; } function makeRandomPassword() { $salt = "abchefghjkmnpqrstuvwxyz0123456789"; srand((double)microtime()*1000000); $i = 0; while ($i <= 7) { $num = rand() % 33; $tmp = substr($salt, $num, 1); $pass = $pass . $tmp; $i++; } return $pass; } function recover_pw($email_address){ if(!$email_address){ echo "<script langauge=\"javascript\">alert(\"".$msg."\");</script>"; include 'lostpsw.php'; exit(); } $sql_check = mysql_query("SELECT * FROM users WHERE email_address='$email_address'"); $sql_check_num = mysql_num_rows($sql_check); if($sql_check_num == 0){ echo "<script langauge=\"javascript\">alert(\"".$msga."\");</script>"; include 'lostpsw.php'; exit(); } $random_password = makeRandomPassword(); $db_password = md5($random_password); $sql = mysql_query("UPDATE users SET password='$db_password' WHERE email_address='$email_address'"); $subject = "Your Password at The Truth Discovered!"; $message = "Hi, we have reset your password. New Password: $random_password http://www.thetruthdiscovered.com/login.php Thanks! The Webmaster This is an automated response, please do not reply!"; mail($email_address, $subject, $message, "From: The Truth Discovered Webmaster<[email protected]>\n X-Mailer: PHP/" . phpversion()); echo "<script langauge=\"javascript\">alert(\"".$msgb."\");</script>"; include 'login.php'; } ?> and let me remind you , this is EXACTLY how it is used on one of my other pages , on the same site , and it works fine Elaine
  9. You will not believe me when i tell you this ! <?php $email_address = "[email protected]"; $subject = "Test"; $message = "Please Work"; $from = "From: The Truth Discovered Webmaster< [email protected]> X-Mailer: PHP" . phpversion(); $mailcheck = mail($email_address, $subject, $message, $from); if($mailcheck) { echo "Your password has been sent! Please check your email!<br />"; }else{ echo "email..failed<br />"; } ?> you see this : $from = "From: The Truth Discovered Webmaster< [email protected]> X-Mailer: PHP" . phpversion(); that little space between Webmaster< admin that was the cause of all this LOL OMG i cant believe it , but we got it fixed I want to thank everyone ! Oh so happy now ! i can go to sleep *hugs* Elaine
  10. I dont no if this is considered a PHP issue or a JAVA issue but on my site i have pop up boxes to notify people if they do not enter certain information in the fields, etc... and it works great on checkuser.php , but i created the forgot password page , which is a whole other story ! ugh! put the exact code from the checkuser.php file to the new file , and i mean i checked it with a fine tooth comb!! to make sure it was exact ! and it works and all the pop up box comes up ! lovely! but with no words in it LOL i dont no what it is ! and variables are set for what the popup box should say! its flawless ! is there a known issue about the words not showing up on the pop up boxes sometimes, cause i go back to the other pages that have them and see the message just fine! so i no it isnt my browser! Help ! Thanks , Elaine
  11. oh sorry Trium918 i thought you were someone else ! hehehe sorry ELaine
  12. i didnt get it working! i am waiting on the hosting guys, they said i should have it working but they figure it is on my side or they said this : Hello, No, you can use the mail() function of php in more than one place without problems. Try to set your script to send out the emails from a mailbox that is created at your domain name on our servers. Best Regards, Bob amazing i dont no what now i told them no we did tests from other computers with the script on other servers even andit worked , but i am still waiting for a response ! go to sleep now i will be back tomorrow and let you know Elaine
  13. Ohh i want to thank you sooo very much your wonderful and im sorry it took so long but your wonderful nonetheless, get some rest ! and thank you again *hugs* Elaine
  14. do host providers usually limit you to the amount of mail() functions you use ! that is ridiculous if that is so ! i will let you know
  15. ok i sent it to you ! i also opened a ticket with the host provider !
  16. yup tried two email address, and the junk folder nothing will try another one
  17. i gives me the confirmation that it went through but it never gets there , and you no the funny thing is , i just registered at my site with bogus information and another email address i have just to test if it is working on that page (register.php) and i got that email , but not the one you got me to test nor the one to reset the password, funny! frustrating but i guess there is nothing else to do but laugh ! i want to thank you for all your help so far it is wonderful but it doesnt make sense that the email goes through with the register.php , but not with the other ones can maybe my webhost limit me to one mail() function? doesnt make sense Elaine
  18. i get this Parse error: parse error, unexpected '\"' in /home/www/thetruthdiscovered.com/testmail.php on line 5 mindu i dont see the unexpected \" anywhere!
  19. oh my where would i put this ?
  20. OMG it worked your wonderful ! but there is a little issue ! i never got the email
  21. there are two files, one called lost_pw.php and the other is lostpsw.php lost_pw.php is the php code that sends the email , lostpsw.php is the actual form that users see Elaine
  22. still flashes and does nothing , can it be in the form i have for the users to put there email in and click get password ? Elaine
  23. no it is not working, i was just saying that what you said above about the form tags must be after and before the header and footer, and i replied that they are like that , still flashes and does nothing Elaine
  24. header.php and footer.php are the top and bottoms of my webpage that never changes, it has the menus and pictures , go see www.thetruthdiscovered.com <?php include 'header.php'; ?> <center> <p align="center"><font face="Calligraphic" size="5" font color="white">New Password Request</font></p> <form action="lost_pw.php" method="post"> <font face="Calligraphic" font color='white' size="4"> Email Address:<font color='white'>*</font> <input type=text name='email_address' size=30><br><br><br> <input type="submit" value="Get Password" name="submit"> </form> </center> <br><br> <?php include 'footer.php'; ?> it is as you said above Elaine
  25. both fails, all it does is when you hit GET PASSWORD, it flashes and the email address you enter disappears, no errors, no emails nothing, maybe something is wrong in my form? Elaine
×
×
  • 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.