Passing data between scripts

This is a discussion on Passing data between scripts within the PHP Language forums, part of the PHP Programming Forums category; I have a php script which displays some HTML stuff along with some images generated on the fly by another ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-04-2005
mpm3@yahoo.com
 
Posts: n/a
Default Passing data between scripts

I have a php script which displays some HTML stuff along with some
images generated on the fly by another php script. Example:

<?php

// Script1.php

$fp = fopen("c:/some_path/file1.txt", "r");
$tmp = explode(" ", fgets($fp));
fclose($fp);

$ts1 = $tmp[1];
$ts2 = ltrim (date("h:iA", strtotime("$ts1 +30 minutes")), 0);
$date = date("D M d, ") ."$ts1 - $ts2.";

echo "<ul><h1 align=\"left\">ABC Company.</h1>";
echo "<h2 align=\"left\">$date</h2></ul>";
echo "<img src=\"Script2.php\" border=0 width=500
height=500><br>;\n";
echo "<br>";

?>

Is there any way that I can have Script2.php access to the array $tmp
without having it (Script2.php) open file1.txt and reading in the data?
It's a large data file, not something I can pass as variables in the
URL. Ex:
echo "<img src=\"Script2.php?var1=$tmp[1]&var2=$tmp[2]\" border=0
width=500 height=500><br>;\n";


Thanks

MPM

Reply With Quote
  #2 (permalink)  
Old 01-04-2005
Daniel Tryba
 
Posts: n/a
Default Re: Passing data between scripts

mpm3@yahoo.com <mpm_three@yahoo.com> wrote:
> <?php
> // Script1.php

[do stuff]
> echo "<ul><h1 align=\"left\">ABC Company.</h1>";
> echo "<h2 align=\"left\">$date</h2></ul>";
> echo "<img src=\"Script2.php\" border=0 width=500
> height=500><br>;\n";
> echo "<br>";
> ?>
>
> Is there any way that I can have Script2.php access to the array $tmp
> without having it (Script2.php) open file1.txt and reading in the data?


You could use a session, the net effect is that the data is written to
another file and script2 reads that file, see the manual at
http://nl2.php.net/manual/en/ref.session.php for more info.

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 09:50 AM.


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