zgkhoo Posted August 21, 2007 Share Posted August 21, 2007 how to make a email inbox like's guestbook? data retrieve from mysql which in multiple pages, display the topic as link....user click the link then redirect to view the detail of the message which the "delete tick" checkbox.. thanks.. Quote Link to comment Share on other sites More sharing options...
Fadion Posted August 21, 2007 Share Posted August 21, 2007 Maybe u could give some details of the script instead of just asking and asking. What u mean with email inbox like guestbook? Are making an email client or smth? I'll try to answer your questions generally: Data retrive from mysql which display in multiple pages: I guess u know how to connect and send queries to a db. For multiple pages use the LIMIT command of mysql. There are a lot of pagination tutorials and thats pretty easy. Display the topic as link which redirects to the full message: echo the topic column of your db between <a> html tags and make the href smth like fullview.php?id=xx where xx is the actual id of that topic. In fullview.php strip the id with get and make a query to show that message. Delete tick checkbox: U may use just simple button, when it is pressed it make the url smth like mypage.php?delete=xx where xx is the id of the message to be deleted. There's nothing complex in this thing, but u need some basic php/mysql knowledge. Quote Link to comment Share on other sites More sharing options...
zgkhoo Posted August 22, 2007 Author Share Posted August 22, 2007 just email inbox alike guestbook, cos i duno which way to start then asking.. thanks for leading me to correct direction. thanks. Quote Link to comment Share on other sites More sharing options...
Fadion Posted August 22, 2007 Share Posted August 22, 2007 If u have written any code or have any reference u are based to, maybe i (and surely others) may help with some real code to help u get better understanding. Quote Link to comment Share on other sites More sharing options...
zgkhoo Posted August 23, 2007 Author Share Posted August 23, 2007 ok, after i write then i post it here.. thanks anyway. Quote Link to comment Share on other sites More sharing options...
Zzzzip1218 Posted January 2, 2010 Share Posted January 2, 2010 I am not sure am not sure if you have found your answer or not. Here’s how I am doing it and if you found a better way, please let me know so I can make mine better. =0) Let’s make some assumptions first... First, I have a table with user’s information, their names, nickname, sign up date and etc. Next, I have a second table that holds user’s encrypted passwords and last time logged in. This table is linked to the Users Info Table with User Info’s primary key. Next we are going to need an “Inbox” table. My inbox table keeps track of where the messages come from, where it goes, what’s its title, what are the contents and when it was sent. I also have a status and a type column. TABLE: Inbox <primary> msgID | <int> CLFrom | <int> CLTo | <text> CLSubject | <text> CLBody | <text> CLdate | <Char(1)> msgStatus | <Char(1)> msgType Now we need a sent box. Because if we have the same inbox and sent box table, then when a recipient deletes a message it will be deleted from sender’s sent box. So we want to keep track of sent and received separately. TABLE: Sent <primary> msgID | <int> CLFrom | <int> CLTo | <text> CLSubject | <text> CLBody | <text> CLdate | <Char(1)> msgType Notice that this table does not have a status. In a more complicated scenario we can have a status table in Sent table and confirm that the message was “Received”. We can do that just by toggling the status column for a sent message when for example the message is clicked and read at the recipient side. Next thing we need is a table to keep track of the responses to the inbox or sent messages. The way this works, we show the user a list of main conversations (unlike Exchange servers or IMAPI or POP3 which shows each message and it marks it as a reply to a certain message). We just want the user to pick a main topic and upon clicking “View Related” for example, we retrieve the list of responses to that message. TABLE: Response <primary> respID | <int>CLFrom | <text>CLSubject | <text>CLDate | <text>CLbody | <Char(1)> CLType | <int> msgID Note that in this table there is only a From which has the userkey for the user who sent the message. We can retrieve the other party information by looking at the main context at the inbox table. Things to consider is that you will need to nl2br the text captured for message body to preserve the \r\n and so on. Minor details =0) So this is putting it all together: INBOX: STATUS DATE FROM SUBJECT DATE RESPONSE: STATUS DATE FROM SUBJECT DATE RESPONSE: STATUS DATE FROM SUBJECT DATE RESPONSE: STATUS DATE FROM SUBJECT DATE INBOX: STATUS DATE FROM SUBJECT DATE RESPONSE: STATUS DATE FROM SUBJECT DATE RESPONSE: STATUS DATE FROM SUBJECT DATE Possibilities are infinite, add a CC or a BCC or save "userkey:userkey:userkey" in the FROM column to send a message to multiple people and so on. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.