|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Can't seem to find the bug in here
//Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect to server"); mysql_select_db("$db_name")or die("cannot select DB"); // value sent from form $email_to=$_POST['email_to']; // retrieve password from table where e-mail = $email_to(email@home.com) $sql="SELECT username FROM proteam WHERE email='$email_to'"; $result=mysql_query($sql); // if found this e-mail address, row must be 1 row // keep value in variable name "$count" $count=mysql_num_rows($result); // compare if $count =1 row if($count==1){ $rows=mysql_fetch_array($result); // keep password in $your_password $your_password=$rows['username']; // ---------------- SEND MAIL FORM ---------------- // send e-mail to ... $to=$email_to; // Your subject $subject="Your username here"; // From $header="from: your name <info@silvercup.ca>"; // Your message $messages= "Your username for login to our website \r\n"; $messages.="Your username is $your_password \r\n"; $messages.="more message... \r\n"; // send email $sentmail = mail($to,$subject,$messages,$header); } // else if $count not equal 1 else { echo "Not found your email in our database"; } // if your email succesfully sent if($sentmail){ echo "Your username Has Been Sent To Your Email Address."; } else { echo "Cannot send username to your e-mail address"; }
__________________
http://www.tnerb.com |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| My site is now on first page of results ... for my username! | bathrobe | Google Discussion Forum | 6 | 12-17-2006 02:47 AM |
| Controlled access (using username and password field) Help | illfoundedmind | Web Programming Discussion Forum | 2 | 07-08-2005 08:05 PM |
| ASP.Net retrieve records from Access DB that start with A | Adamwlad | Database Discussion Forum | 2 | 12-15-2004 06:21 PM |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |