|
|
|
|
![]() ![]() |
Feb 13 2008, 12:28 AM
Post
#1
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 128 Joined: 24-November 07 From: Wales(But I'm not a welsh farmer!) Member No.: 53,645 |
Hey guys, I Really need a PHP based email system it needs to be able to
I am making a control panel for a subdomain that i've given to my friend, He needed an email address (so i gave him one). Now I adore squirell mail, I even tried to make that work to what i want! So basically what needs to happen is Bob will log onto his control panel that i will be building, He will then click a button titled E-mail Now heres the bit i've been struggling with it will automatically log him on. His email address is kieran@rotf.urbaninsticts.trap17.com So rather than him having to type that all the time it'll already know it. Like cPanel, That is ideal! That is exactly how I want it! You just go into Read Webmail and hey presto your done, no login in needed I've attached the File I've used if anyone wants to look and possibly edit How would I make the login screen automatically, "put" the email address in? Well rather than ask any more questions and confuse everyone some more, Look at your cPanel on trap in E-mail Is a section that says Read webmail... Click it it then takes you to a choice of two, But when you click it your reading your default email account! Am I making sense now? lol (I do annoy people with not making sense so i've tried my best!) Thanks to anyone in advance karlos Opps forgot to attach file p.s I was wondering how would I make it use cookies? would that help? If yes then how do i make my email system use a cookie rather than a login screen? This post has been edited by karlosantana: Feb 13 2008, 01:03 AM
Attached File(s)
|
|
|
|
Feb 15 2008, 11:21 AM
Post
#2
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 128 Joined: 24-November 07 From: Wales(But I'm not a welsh farmer!) Member No.: 53,645 |
Ok i've only given half the story there, here's the login script. It uses a msql table called members, and in that is
user_id user_name user_password I wonder if i was to put a user_email in it and then get the email system above to recall it using echo? If im wrong there can you please correct me? I would just need it to call the user_email from the MYSql database As you would've guessed I've just started with php! SO any help and tips and things will help greatly! ok here goes CODE <?php ob_start(); $host="localhost"; // Host name $username=""; // Mysql username $password=""; // Mysql password $db_name="test"; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // Define $myusername and $mypassword $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" session_register("myusername"); session_register("mypassword"); header("location:login_success.php"); } else { echo "Wrong Username or Password"; } ob_end_flush(); ?> Any help is appreciated! Thanks in advance Karlos EDIT: i had put the wrong version of my script in, its better now! This post has been edited by karlosantana: Feb 15 2008, 11:23 AM |
|
|
|
Feb 16 2008, 02:58 PM
Post
#3
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 150 Joined: 9-April 07 From: Nebraska Member No.: 41,301 |
I had never used the $_SESSION before, because I always used cookies, but I just looked it up, and it said you need to do a "session_start()" before reading from the $_SESSION[] vars, if you haven't called a session_register on that page.
So on the page you're going to (login_success.php), make sure you're calling session_start() before reading to see if they're logged in. Also, most browsers should have the "remember me" box pop up when you're logging in, if that's part of what you were talking about. |
|
|
|
Feb 16 2008, 03:33 PM
Post
#4
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 128 Joined: 24-November 07 From: Wales(But I'm not a welsh farmer!) Member No.: 53,645 |
QUOTE I had never used the $_SESSION before, because I always used cookies, but I just looked it up, and it said you need to do a "session_start()" before reading from the $_SESSION[]vars, if you haven't called a session_register on that page. Hmm interesting point but it works fine as it is, so im content as a cucumber to leave it as it is. You use cookies? do tell! QUOTE So on the page you're going to (login_success.php), make sure you're calling session_start() before reading to see if they're logged in. My page does include that! hehe i guess I should've mentioned it really, And i've just made a logout script to (YAY) I am very new to php. So this is a huge learning curve for me!QUOTE Also, most browsers should have the "remember me" box pop up when you're logging in, if that's part of what you were talking about. No it wasn't. I need basically to make a php email Client for ONE account I think i've made one though (eeek) so any help is well appreciated, you seem to know your stuff when it comes to php and tips you can give me are appreciated! Thanks again karlos |
|
|
|
Feb 18 2008, 12:58 AM
Post
#5
|
|
|
Newbie [Level 3] ![]() ![]() ![]() Group: [HOSTED] Posts: 42 Joined: 17-February 08 Member No.: 58,025 |
the thing you ask is quiet something, it's total mail solution lol
i found and used something which was quite good for sending emails, the problem with it is gmail takes that as spam and also it can not reflect html codes properly if you attach something (when you modify it it goes funny a bit) but it works for sending attachments. it never passed my mind to code something or find some codes to receive emails as well. why you need it? This post has been edited by threepach: Feb 18 2008, 01:00 AM |
|
|
|
Feb 18 2008, 08:54 PM
Post
#6
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 128 Joined: 24-November 07 From: Wales(But I'm not a welsh farmer!) Member No.: 53,645 |
I'm making something and in it I need an email system.
But could the above be done? could i make a "bridge" between my login script and my email script? Thanks for the help! karlos |
|
|
|
![]() ![]() |
Similar Topics
| Topics | Topics | |
|---|---|---|
|
|
|
|
Lo-Fi Version | Time is now: 27th July 2008 - 02:08 AM |