473,471 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

Jul 17 '05 #1
1 1715
mp**@yahoo.com <mp*******@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.

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Duyet The Vo | last post by:
Hi, script_a.php .... $data = array ( ..., ... ); <a href="script_b.php?data=$data">script b</a> .... ========== script_b.php
14
by: Antoni | last post by:
Hello, I wondered if anyone could offer some guidance over my php script. I was hoping the example would allow the user to click the submit buttons and the item number increment. And when the...
3
by: redneck_kiwi | last post by:
Hi all: I have a really weird problem. I am developing a customer catalog system for my company and as such have delved into sessions for authentication and access levels. So far, I have managed...
1
by: Joe | last post by:
I am trying to write a Perlscript to be used with some HTML pages. Here is how it works: 1.. The first HTML page has a form which requests for user input. Then it passes the QUERY_STRING...
3
by: Gung Ho | last post by:
Has anyone had success passing variable data between ASP scripts and Javascript?
4
by: Jason Us | last post by:
Does anyone have experience with passing variables from an ASP page to a JSP page. The way it currently works in passing the SSN in the URL. This cannot be good. I thought that storing a...
11
by: comp.lang.php | last post by:
On one of my sites, I have a TCL CGI script that has a security hole in spite of it having effective server-side validation (the fact that it's CGI IS its security hole). The front end is a PHP...
25
by: Stuart Hilditch | last post by:
Hi all, I am hoping that someone with some experience developing nTier apps can give me some advice here. I am writing an nTier web app that began with a Data Access Layer (DAL), Business...
3
by: harryusa | last post by:
My scripts are successfully passing single variables and arrays from page to page but I can't get $_Session = time(); to work. I have tried "time()" in an attempt to make it a string and a dozen...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
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...
0
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,...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
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 ...
0
muto222
php
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.