Jump to content

sw45acp

Members
  • Posts

    67
  • Joined

  • Last visited

    Never

Everything posted by sw45acp

  1. positive that $email is not empty. I think maybe something is wrong w/ the server. Because even this simple page doesnt do it. <?php if (isset($_POST["submit"])) { $email = $_POST["email"]; //compose email parts $subject = "MHS WTP Control Panel"; $message = "Please confirm this change by clicking the link below:\r\n"; $message .= '<a href="https://mhswtpmanage.c6.ixwebhosting.com/cp_info.php">https://mhswtpmanage.c6.ixwebhosting.com/cp_info.php</a>'; ini_set('sendmail_from','[email protected]'); $sentmail = mail($email,$subject,$message); if (!$sentmail) { die('Could not send mail'); } else { echo "all good" . "<br />"; } } ?> <html> <head> </head> <body> <form action="test2.php" method="post"> Enter email:<br /> <input type="text" name="email" /><br /> <input type="submit" name="submit" value="Submit" /> </form> </body> </html>
  2. ive reduced it down further to this, and removed the outside if() condition no success yet <?php <?php $email = $_POST["email"]; //compose email parts $subject = "MHS WTP Control Panel"; $message = "Please confirm this change by clicking the link below:\r\n"; $message .= '<a href="https://mhswtpmanage.c6.ixwebhosting.com/">https://mhswtpmanage.c6.ixwebhosting.com/cp_info.php</a>'; ini_set('sendmail_from','[email protected]'); $sentmail = mail($email,$subject,$message); if (!$sentmail) { die('Could not send mail'); } else { echo "all good"; } ?> ?>
  3. no luck man. I also tried reducing it just down to this: if (isset($_POST["change_email"])) { $email = $_POST["email"]; //compose email parts $subject = "MHS WTP Control Panel"; $headers = "You have changed your login email address for the control panel."; $message = "Please confirm this change by clicking the link below:\r\n"; $message .= '<a href="https://mhswtpmanage.c6.ixwebhosting.com/">https://mhswtpmanage.c6.ixwebhosting.com/cp_info.php</a>'; //ini_set('sendmail_from','[email protected]'); //doesnt work whether I have ini_set in there or not $sentmail = mail($email,$subject,$message,$headers); if (!$sentmail) { die('Could not send mail'); } else { echo "all good"; } }
  4. oh! sorry here is the source for this one <?php if (isset($_POST["submit"])) { $email = $_POST["email"]; //gather parts $subject = "test"; $header = "more test"; $message = "even more test\r\n"; $message .= '<a href="http//www.google.com/">Google</a>'; ini_set('sendmail_from','[email protected]'); $sentmail = mail($email,$subject,$message,$header); if (!$sentmail) { echo "Could not send mail"; } else { echo "Sent mail, and the link does appear this time.<br />"; echo $subject . "<br />" . $header . "<br />" . $message . "<br />"; } } ?>
  5. no it didnt work again. bu here is a simple one I just built... and this one works: http://mhswtpmanage.c6.ixwebhosting.com/test.php i dont under stand what the difference is
  6. maybe the php.ini file isnt set up right, but I dont have access to it, so thats why I've always used ini_set()
  7. commenting that out either doesn't work, because it doesn't send it at all if (isset($_POST["change_email"])) { $token = $_POST["token"]; //generate unique id $uid = md5(uniqid(rand(), true)); $sql = mysql_query("UPDATE admin SET `uid` = '$uid' WHERE `password` = '$token'"); if (!$sql) { die('Could not execute query!: ' . mysql_error()); mysql_close($con); } else { mysql_close($con); $email = $_POST["email"]; //compose email parts $subject = "MHS WTP Control Panel"; $headers= "You have changed your login email address for the control panel."; $message = "Please confirm this change by clicking the link below:\r\n"; $message .= '<a href="https://mhswtpmanage.c6.ixwebhosting.com/">https://mhswtpmanage.c6.ixwebhosting.com/</a>'; //ini_set('sendmail_from','[email protected]'); $sentmail = mail($email,$subject,$message,$headers); if (!$sentmail) { die('Could not send mail'); } else { //continue on to next page } } }
  8. no luck
  9. hi, im trying to send an email confirmation link to someone when they want to change their email address. when I include a link in the email, it does not send! if (isset($_POST["change_email"])) { $token = $_POST["token"]; //generate unique id $uid = md5(uniqid(rand(), true)); $sql = mysql_query("UPDATE admin SET `uid` = '$uid' WHERE `password` = '$token'"); if (!$sql) { die('Could not execute query!: ' . mysql_error()); mysql_close($con); } else { mysql_close($con); $email = $_POST["email"]; //compose email parts $subject = "MHS WTP Control Panel"; $header = "You have changed your login email address for the control panel."; $message = "Please confirm this change by clicking the link below:\r\n"; $message .= "https://mhswtpmanage.c6.ixwebhosting.com/cp_info.php?token=$token&uid=$uid"; //if $message was "http://www.google.com/" it works, or if it was "bla sldjfalkdjf" it works. //but it doesnt work with that url. I don't think secure connections have anything to do with it ini_set('sendmail_from','[email protected]'); $sentmail = mail($email,$subject,$message,$header); if (!$sentmail) { die('Could not send mail'); } else { //continue on to next page } } } maybe it is because the send mail function is too deep into the code, i dont know. any ideas?
  10. thank all of you for your help. I have no idea how you people know all this!!
  11. the page the form is displayed on is test.php?id=anny random id, this is generated from another page the form action = test.php, which is the same page how would I get it to save its value during the processing?
  12. so in other words, this wouldnt work? <?php isnt GET used to get urls from address bar? //this works fine $id = $_GET["id"]; echo $id; //yet again this doesnt if (isset($_POST["submit"])) { echo $id; } ?> <form action="same as page" method="post"> <input type="submit" name="submit" value="submit" /> </form> example url: http://www.test.com/test.php?id=17, this is NOT the form action
  13. that is the url that the form is working off of, using any random id
  14. .../_delete.php?id=7
  15. this has gotta be the most annoying thing: i'm trying to retrieve a variable from the url bar, and then write it out when the user presses the submit button. all I need is for someone to be able to press the button, like OK to delete something <?php //this works fine... $id = $_GET["id"]; echo $id; //but this doesn't... $id = $_GET["id"]; if (isset($_POST["submit"])) { global $id; echo $id; } ?> and the form code <form action="same page as script" method="post"> <input type="submit" name="submit" id="submit" value="submit" /> </form> i have no clue what's wrong here, even delcaring id as a global variable wont work, i have tried setting form to method="get", that doesnt work, $_REQUEST doesn't do it, I do have superglobals and register_globals on any clues??
×
×
  • 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.