Output to another window

This is a discussion on Output to another window within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I'm new to php and was wondering if the following was possible... I would like to have a list ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-01-2006
astromac
 
Posts: n/a
Default Output to another window

I'm new to php and was wondering if the following was possible...

I would like to have a list of items loaded from a text file, process
each item in the list and then return the processed result to a new
window so that the new window displays the results, one by one, until
it is done processing the list.

I considered javascript but the whole client-side/server-side divide
seems difficult for this newbie to figure out. Is what I want possible?

Reply With Quote
  #2 (permalink)  
Old 02-05-2006
Jim Michaels
 
Posts: n/a
Default Re: Output to another window


"astromac" <obearsstate@gmail.com> wrote in message
news:1138811873.863948.221040@o13g2000cwo.googlegr oups.com...
> I'm new to php and was wondering if the following was possible...
>
> I would like to have a list of items loaded from a text file, process
> each item in the list and then return the processed result to a new
> window so that the new window displays the results, one by one, until
> it is done processing the list.
>
> I considered javascript but the whole client-side/server-side divide
> seems difficult for this newbie to figure out. Is what I want possible?
>


this is mostly a javascript problem. your PHP will write sequences of
javascript which concatenate strings (or just create one big one). note
that disabled users may not necessarily have javascript on their machine.
<script language="javascript">
var page = "<html><head><title>one sub window</title></head>";
page += "<body><h1>this window is new.</h1></body></html>";
var w =
window.open("","NewWindow","toolbar,status,resizea ble,location,scrollbars,menubar");
if (null != w) {
w.document.write(s);
} else {
document.write("your popup blocker needs to be disabled.");
}
</script>

in PHP, readfile() will simply dump a file's contents to the browser. if it
has line breaks in it, you can't use it for making javascript strings.
you must process the file from PHP. use fopen, fread, and fclose. with
fread you must specify the number of bytes to read, so you might as well
make it something like 8192. or make it big enough to read the entire file
in at once, then strip out or process the \n linebreaks. maybe explode on
them and output the resulting array.

I am not sure exactly what you are trying to do, but I hope this helps.


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:51 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0