Jump to content

Search the Community

Showing results for tags 'email info from db'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Good Morning, I am building a system at work with Mysql and PHP with regards to log-in's and submitting information. I need to send the form info to my Database (which works great) but now I have to send the information that was submitted into the Databse to the applicable users email address, this user then has to click a link in the mail to take him/her to continue. I am struggling horribly with the email function.. Here is my code that I am using: <?php $conn = mysql_connect("localhost","root","root"); $db = mysql_select_db("mysql",$conn); ?> <?php $alloc = $_POST["alloc"]; $allocby = $_POST["allocby"]; $specification = $_POST["specification"]; $reqno = $_POST["reqno"]; $scheme = $_POST["scheme"]; $fromtime = $_POST["fromtime"]; $totime = $_POST["totime"]; $targetdate = $_POST["targetdate"]; $comments = $_POST["comments"]; if($alloc == "s"){ $alloc = 'MHAS002 - AS'; }else if ($alloc == "t"){ $alloc = 'MHMS004 - SM'; }else if ($alloc == "u"){ $alloc = 'MHMN005 - MM'; }else if ($alloc =="v"){ $alloc = 'MHMW005 - MVW'; }else if ($alloc == "w"){ $alloc = 'MHGC001 - GC'; }else if ($alloc == "x"){ $alloc = 'MHGK002 - GDP'; }else if ($alloc == "y"){ $alloc = 'MHLW009 - LW'; }else if ($alloc == "z"){ $alloc = 'MHZP001 - ZP'; }; if($allocby == "a"){ $allocby = 'LM; }else if ($allocby == "b"){ $allocby = 'User'; }else if ($allocby == "c"){ $allocby = 'Other'; }; $sql = "INSERT into manspecification values('$alloc','$allocby','$specification','$reqno','$scheme','$fromtime','$totime','$targetdate','$comments')"; $query = mysql_query($sql); if(!$query) echo mysql_error(); else { echo "Successfully Inserted<br />"; } $to = "johnny@johnny.co.za"; $subject = "Specification"; $email = $_POST['Email']; $message = $_POST['Spec']; $headers = "From: [email="$johnny@gmail.com"]$johnny@gmail.com[/email]"; $sent = mail($to, $subject, $message, $headers); if($sent) {print "Your mail was sent successfully"; } else {print "We encountered an error sending your mail"; } ?> <p> </p> <table border="0" cellspacing="0" cellpadding="3"> <tr><td> Allocated To: <td> <?=$alloc?> <tr><td> Allocated By: <td> <?=$allocby?> <tr><td> Spec Info: <td> <?=$type?> <tr><Td> Request No: <td> <?=$reqno?> <tr><td> Scheme: <td> <?=$scheme?> <tr><td> From Time: <td> <?=$fromtime?> <tr><td> To Time: <td> <?=$totime?> <tr><td> Target Date: <td> <?=$targetdate?> <tr><td> Comments: <td> <?=$comments?> <td> <td> </td> </table> </form> <p><A HREF="/manspesifications.html" target="_self"><strong>Go back</strong></A></p> </body> </html> I would apprecaite any help with this as this would be the first time that I am working with php and not to mention emails in phph *blush* :'(
×
×
  • 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.