473,800 Members | 2,640 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Show image while in background PHP script executes

realin
254 Contributor
hiya guys,

I have a question, i want to display the image which is above the page, while my script loads in the background.
This is a simple script which check for new messages in my mailbox, so it is more like GMAIL's loading bar which is shown just before we land into our mailboxes.

Guys, how do i do it ? Because i have tried ob_start and ob_end_flush, but with no luck i am unable to see the image before script terminates. The whole data is shown into browser in one go. How do i slice it ..

The piece of code is like this ::

[PHP]
<?php
require_once("l ib/POP3.php");
include('lib/mimeDecode.php' );
require_once(". ./config/config.inc.php" );

echo '<img src="loader.gif " />';



function gmail($em){
$start=strrpos( $em,"&lt;");
$end=strrpos($e m,"&gt;");
$len=$start+4;
$email=substr($ em,$len,$end-$len);
return $email;
}

/*************** *** Function to parse message and splits the needful into parts *************** ****/
function parse_output(&$ obj, &$parts){

if(!empty($obj->parts)){
for($i=0; $i<count($obj->parts); $i++)
parse_output($o bj->parts[$i], $parts);

}else{
$ctype = $obj->ctype_primary. '/'.$obj->ctype_secondar y;
switch($ctype){
case 'text/plain':
if(!empty($obj->disposition) AND $obj->disposition == 'attachment'){
$parts['attachments'][] = $obj->body;
}else{
$parts['text'][] = $obj->body;
}
break;

case 'text/html':
if(!empty($obj->disposition) AND $obj->disposition == 'attachment'){
$parts['attachments'][] = $obj->body;
}else{
$parts['html'][] = $obj->body;
}
break;

default:

$parts['attachments'][] = $obj->body;
$parts['attachments']['name']=$obj->ctype_paramete rs['name'];
}
}
}
/*************** Variable Initialization ************/

$user='realin@d omain.com';
$pass='realin';
$host='mail.dom ain.com';
$port="110";
$commid=(int)"6 ";
/*@ var total number of messages
in the inbox */
$nTotal="";

/* @var Messages which are
being retrieved */
$retr="";


$my=array();
$data=array();
$obj=&new Net_POP3();

$obj->connect("$host ","$port");
$ret=$obj->login($user , $pass,'USER' );
if(is_object($r et))
echo "Invalid Username/Password";

/********** Gets the office status of the mailbox, viz number of messages,size,U ID *************/
$listing=$obj->getListing() ;



foreach($listin g as $l){
$id=$l["msg_id"];
$head[$id]=$obj->getParsedHeade rs($id);
$body[$id]=$obj->getMsg($id);
}
?>
[/PHP]
May 19 '08
20 13525
TheServant
1,168 Recognized Expert Top Contributor
"To fear the unknown is equal to fearing knowledge." --Dan M.
The fear of the LORD is the beginning of knowledge; fools despise wisdom and instruction. -- King Solomon & God

Been reading Proverbs recently!
May 21 '08 #21

Sign in to post your reply or Sign up for a free account.

Similar topics

5
3483
by: Al Davis | last post by:
Note: I tried cross-posting this message to several newsgoups, including comp.lang.perl.misc, c.l.p.moderated, comp.infosystems.www.authoring.cgi, comp.lang.javascript and comp.lang.php. Nothing appeared on my news server, so I'm trying again - this time posting a separate copy of the message to each group. I'm thinking this should be fairly easy to accomplish - a quick and dirty ... what? ... script? program?
4
2489
by: Dj Frenzy | last post by:
Hi, I know how to use javascript to change a background image to another background image, and how to change a background colour to another background colour. Is there a way to change an image to a backgound colour? I have a table with a background that has a picture. When the user hovers over the picture I want the background to change to the background colour of the rest of the page, as if to make the picture disappear.
4
4942
by: Amir | last post by:
Hi, I'd like to know if it's possible to pass an image name (the IMG SRC attribute) from HREF element to a function that is activated by onClick event and creates a Web page. I have this HREF element: <A HREF onClick="showLargePicture()"><IMG HEIGHT=25 SRC="test01.jpg"></A>
1
2112
by: Littlefire | last post by:
Hi all I wrote a proxy script that fetches images out of a database and sends the data to the browser, using the Content-type header. For instance, if I'm loading a jpg image from the database, the script's output will be: header("Content-type: image/jpeg"); header("Content-length: <filesize-goes-here>"); print $imagedata;
1
2201
by: M | last post by:
Hi all, This is the script I use to find coordinates on a map and transfer them to textfields in the openerwindow. ++++++++++++++++++++++++ <HTML> <HEAD> <TITLEMouse Coords </TITLE> <script language="JavaScript"> <!--
1
3149
by: rsteph | last post by:
I've got some product information pages, with images and text, all setup within a table. I'm trying to add a small image in the upper right hand corner of the content div (where all the important information is). I've got the product name at the top, left aligned and typically as a two lined header, and I'd like to add a small logo to the right of that, either right beside it, or in the far right corner. could anyone help me with how to set...
6
5427
by: yogarajan | last post by:
Hi All <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> </HEAD> <style type="text/css"> #map {
16
4940
by: stevedude | last post by:
CSS newbie again. I have a problem trying to get coffee mug images within anchor tags to center with my link text for a vertical list menu. If I use the horizontal/vertical properties of "background" or "background-image", the positioning only works with specifying pixels. If I specify the vertical position in pixels, the image gets cut-off at the bottom. I don't know what to do and would appreciate anyone's help. Specifically the code...
1
3814
oranoos3000
by: oranoos3000 | last post by:
hi would you please help me i have a online shopping center that i show pictures of the my product in home page. in the InterExplorer pictures is shown correctly but in Firefox browser is shown properties alt in img tag istead of picture . place of the pictures is saved in the database(my database is with mysql) and in home page i fetch properties of the product and address of place that pictures is located output of the code in the...
0
10501
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10250
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7574
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5603
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.