473,474 Members | 1,682 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

PHP Program Execution Problem

Hi All

Im having a minor issue performing a system command with exec(). I
want to use the filenames of files that I uploaded within the command,
but cannot escape once inside the exec() function. For example, lets
say I just uploaded two files, file1.txt and file2.txt. I want to list
the contents of those two files by using the command:

cat file1.txt file2.txt

But I'm having problems using the names of the files uploaded. I used
a for loop to grab each file name and put them in an array, and can
successfully view the array to verify its contents. The problem occurs
when I try this:

exec('cat " . $Array['0'] . " ....blah blah

This is just an example so you can understand what Im trying to
accomplish.

TIA
Rob

Oct 5 '05 #1
1 1442
cat file1.txt file2.txt But I'm having problems using the names of the files uploaded. I used
a for loop to grab each file name and put them in an array, and can
successfully view the array to verify its contents. The problem occurs
when I try this: exec('cat " . $Array['0'] . " ....blah blah


You probably need to move the files from the temporary upload directory
before you can process them.

See <http://www.php.net/features.file-upload> and
<http://www.php.net/manual/en/function.move-uploaded-file.php>.

---
Steve

Oct 5 '05 #2

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

Similar topics

4
by: Bruce W...1 | last post by:
A scripting newbie question... I'm trying to understand some code I found. This script conducts a poll and writes the results to a text file. The following statement is part of the source file. ...
6
by: shoo | last post by:
Any one know how to do this? thank Write a simple text-formatting program that produces neatly printed output from input text containing embedded command lines that determine how to format the...
6
by: shoo | last post by:
Any one know how to do this? thank Write a simple text-formatting program that produces neatly printed output from input text containing embedded command lines that determine how to format the...
4
by: Casual Reader | last post by:
Hi, I have a C# program that in principle should only use a constant amount of memory to execute (with periodic garbage collection) and in fact does so when executed in Mono under either Windows...
4
by: Chris | last post by:
I posted this in the C# language group, then thought it might be more appropriate in this group. I would not cross-post except I want the answer so badly. I built small C# Web and Web Service...
3
by: I. Myself | last post by:
I can't get this to work: # commer.py - to test communication with other process from popen2 import popen2 (child_stdout, child_stdin) = popen2("commer.exe") print "Got here 1" line =...
8
by: lovecreatesbea... | last post by:
K&R 2, sec 2.4 says: If the variable in question is not automatic, the initialization is done once only, conceptually before the program starts executing, ... . "Non-automatic variables are...
5
by: Dave Griffiths | last post by:
Hi All Using vb 2005 I have noticed that sometimes (not everytime) after closing a program I have written it is still running in the task manager. The programs are very short, just small...
4
by: sulekhasweety | last post by:
Hi, can any one give a brief outline of the different stages in the execution of a C program , in terms of compilation, pre-processing, linking etc
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,...
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,...
1
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...
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: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.