单击超链接刷新网站部分
所以,我正在为自己制作一个 PHP 邮件网站,我不喜欢每次单击新邮件/电子邮件/文件夹等时它都会刷新。
所以,我想知道它们是否是一种方法(我知道他们是,并使用我通过Google收集的AJAX),让它让我登录到一个新邮箱,与文件夹或实际电子邮件/主机/端口/密码不同。
示例:
如果我单击列表中的一封电子邮件,它会加载“消息视图”并仅刷新网页中包含该消息的部分。所以它就是:
echo imap_fetchbody($mbox,$mID,1);
其中 $mbox 只是邮箱,$mID 只是消息号。
此外,类似地,我希望它对实际的 imap_open 函数执行相同的操作,即单击时更改电子邮件/端口/主机,但同样,不要刷新整个页面,而只是刷新文件夹/消息上市。
$mbox = imap_open ("{".$imaphost.":".$imapport."/imap/ssl}" . $folder , $email , $password);
所有变量都是他们所说的,但它们可以通过单击我的电子邮件列表的超链接进行更改。
我希望我足够彻底,我真的只需要一个教程,或者一个关于它如何工作/我如何让它工作的清晰解释。
非常感谢,祝您晚上愉快!
So, I have I'm making a PHP Mail website for myself, and I don't like how it refreshes every time I click a new mail/email/folder etc.
So, I was wondering if their is a way (I know their is, and with AJAX from what I've collected through Google), to have it log me in to a new mailbox, differing with the folder or with the actual email/host/ports/passwords.
Example:
If I click on an email in the list, it loads the "Message View" and refreshes ONLY that part of the webpage with the message. So it'd just be:
echo imap_fetchbody($mbox,$mID,1);
where $mbox is just the mailbox, and $mID is just the message number.
Further, and similarly, I would like it to do the same for the actual imap_open function, as to change the email/port/host on a click, but again, NOT refresh the page as a whole, but rather just the folders/message listing.
$mbox = imap_open ("{".$imaphost.":".$imapport."/imap/ssl}" . $folder , $email , $password);
Where all the variables are what they say, but they can change on the hyperlink click of a list of my emails.
I hope I was thorough enough, and I really just need either a tutorial, or a clear explanation of how this works/how I can get it to work.
Thanks a lot and have a good evening!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
本教程可能会帮助您入门:
http://www.jensbits.com/2009/10/04/jquery-ajax-and-jquery-post-form-submit-examples-with-php/
本教程使用表单变量,因此您可能希望使用 ajax 或 post 函数中的 data 参数发送变量:
This tutorial might get you started:
http://www.jensbits.com/2009/10/04/jquery-ajax-and-jquery-post-form-submit-examples-with-php/
The tutorial uses form variables so you may want to send your variables using the data parameter in the ajax or post function: