Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another Question

Status
Not open for further replies.

ronnyjljr

IS-IT--Management
Joined
Nov 23, 2003
Messages
249
Location
US
On my webmail system the inbox does not show up correctly when the user first logs in, it instead shows about 20 characters of html coding after the main header image is displayed. Only after I refesh the page does the rest of the script work. Is there any code that will refresh the page or fix this error for me?

-Ron
 
The code won't even make it to that part, it makes it to the line right before I create the table to specify what each item is, like Delete, Subject, Sender, yada, it will show a part of the html and quit therfe, but once you refresh the code below works properly.


This is the code that does all the work:
<?
$pop_connect = imap_open(&quot;{localhost:110/pop3/notls}INBOX&quot;,$accountfull,$password,OP_HALFOPEN) or die(&quot;Can not connect to POP mailbox&quot;);
$message_total = imap_num_msg($pop_connect);

if ($message_total==0){
echo &quot;<tr bgcolor=\&quot;#999999\&quot;>&quot;;
echo &quot;<td colspan=\&quot;6\&quot;><div align=\&quot;center\&quot; class=\&quot;whitetext style12\&quot;>No Messages To Display </div></td></tr>&quot;;
}
else{
for($i=$message_total;$i>0;$i--){
$message_info = imap_header($pop_connect,$i);
$email_from = substr($message_info->fromaddress,0,19);
if (strlen($message_info->Subject)>1) $email_subject = substr($message_info->Subject,0,30);
else $email_subject =&quot;No Subject&quot;;
$email_date = substr($message_info->Date,5,11);
echo &quot;<tr bgcolor=\&quot;#999999\&quot;>&quot;;
echo &quot;<td><div align=\&quot;center\&quot;><input type=\&quot;checkbox\&quot; name=\&quot;$x\&quot; value=\&quot;DELETE\&quot;></div></td>&quot;;
echo &quot;<td class=\&quot;whitetext\&quot;>$email_subject</td>&quot;;
echo &quot;<td class=\&quot;whitetext style11\&quot;>$email_from</td>&quot;;
echo &quot;<td class=\&quot;whitetext\&quot;><div align=\&quot;center\&quot;>SIZE</div></td>&quot;;
echo &quot;<td class=\&quot;whitetext\&quot;><div align=\&quot;center\&quot;>$email_date</div></td>&quot;;
echo &quot;<td class=\&quot;whitetext\&quot;><div align=\&quot;center\&quot;>Shrug</div></td></tr>&quot;;
}
}
?>


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top