How do get email from database?

Reply

Join Date: Jul 2009
Posts: 34
Reputation: NoID is an unknown quantity at this point 
Solved Threads: 0
NoID NoID is offline Offline
Light Poster

How do get email from database?

 
0
  #1
Jul 14th, 2009
Hello Guys,

I would like to know if its possible or not, where i can have a text box which when i enter the ID and press submit it gets the email matching that ID. and sends an email, please note that i know how to send email, i just dont know how to get data and send it can someone please give me an example on how i would do this. THank you

Have a good day
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 171
Reputation: Menster is an unknown quantity at this point 
Solved Threads: 22
Menster's Avatar
Menster Menster is offline Offline
Junior Poster

Re: How do get email from database?

 
0
  #2
Jul 14th, 2009
I'm not sure what you need: the HTML form, the SQL statement or the PHP to run it? or do you just want to pass?
$me = new Person();
if (isset($_COOKIE)){
$me->eat($_COOKIE);
} else { $me->starve(); }
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 34
Reputation: NoID is an unknown quantity at this point 
Solved Threads: 0
NoID NoID is offline Offline
Light Poster

Re: How do get email from database?

 
0
  #3
Jul 14th, 2009
Hello,

I have a form when everytime i fill, it gives a unique id for example

name
surename
address
postcode
email@email.com
ID: 4

name
surename
address
postcode
email1@email.com
ID: 5

name
surename
address
postcode
email2@email.com
ID: 6

I then want a text box on say page called email.php

is like this

----------------
5 |
--------------- submit

when i click on submit, it goes to server and finds the email for record 5 and sends an email.

I hope that makes sense, thank you

have a good day
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 94
Reputation: sikka_varun is an unknown quantity at this point 
Solved Threads: 11
sikka_varun's Avatar
sikka_varun sikka_varun is offline Offline
Junior Poster in Training

Re: How do get email from database?

 
0
  #4
Jul 14th, 2009
  1. <?php
  2.  
  3. if($_POST['submit'] == "Send Email")
  4. {
  5. $sql = "Select * from tablename where id=".$_POST['id'];
  6. $res = mysql_query($sql);
  7. $data = mysql_fetch_array($res);
  8.  
  9. $to_email = $data['email'];
  10.  
  11. //Send mail here
  12. // mail($to_email,$subject,$msg);
  13. }
  14.  
  15. ?>
  16. <form name="frmEmail" action="" method="post">
  17. <input type="text" name="id" id="id" />
  18. <input type="submit" name="submit" id="submit" value="Send Email" />
  19. </form>
Last edited by sikka_varun; Jul 14th, 2009 at 9:36 am. Reason: Changing $_SUBMIT to $_POST
VâRûN
---Happy to Help---
sikka_varun@yahoo.com
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC