Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Multiple Local PHP Files


I'm making a page using PHP, and including varios files for navigation bars and such.. However, my problem is that I can't include multiple PHP files locally. After including the first one, everything after that has to be an html include, or a remote php include. PHP Code:

<?php
echo <<<BEGINHTML
<html>
<head>
</head>

<body>

BEGINHTML; //This will print
include("banner.htm"); //As will everything from here to
echo "
##Printed banner
";.....




View Complete Forum Thread with Replies

Related Forum Messages:
Viewing WordPress PHP Files On Local PC
I am looking for a way to open WP's files on my local machine that will allow me to view them "in a clean" - line by line - way.

In other words, I'd like to view the code in a way that I could begin to understand the step-by-step logic of the code. What is the trick, if any, that might allow me to somewhat unscramble the code? Code:

View Replies !
Writing Files To Local Machine
Does anyone know how to, using PHP or other, to automatically write files from a mySQL database on a server to a local machine? Basically the reason I need it, is that the database will be continually getting new data from various users, and I want the information to be copied to a local file on my own computer every 15 minutes or so (just continually rewriting the file on my local machine, with the newest data). This way, if there is a server error, or internet connectivity issues, I will still always be able to access the latest data by opening the file on my local machine.

View Replies !
Parsing HTML Files On Local Computer
I would like to be able to open and read HTML files that are on my local (client) computer and then parse them to extract some specific information they contain.

I've been looking here and reading my PHP books, but it appears to me that PHP only opens files on the server or URLs. It think that makes sense to me. Is there an alternative?

View Replies !
Link To Local Files Through A Dynamic Page
I decided to flesh out my php skills by building a web application
which could scan through local files on my intranet (specifically
mapped drives on my server) and generate a list of Movies or pictures
or music, etc. Which worked fine, I created the code to do that and to
store the results in a mysql database. I can even print it out to a
..php page and sort it however I like.

What I can't seem to do is to create links to the data I've indexed in
a way that will let me open them from the generated php page. I've
searched and searched and there just doesn't seem a way to do this.
I'm pretty sure I've exhausted the obvious options.

The following trials did not work when the document was served from an
apache web server.

<?php
echo "<h1><a href=file:///c:/temp.txt> HEY </a></h1>";
echo "<h1><a href=file:///c: emp.txt> HEY </a></h1>";
?>
<a href=file:///c: emp.txt target="_top"> temp.txt </a>
<a href=file:///c:/temp.txt target="_top"> temp.txt </a>

When the same page was loaded directly from the file instead of served
through apache the bottom two links worked. This doesn't really help
me however. I need to be able to dynamicly generate pages that link to
the files.

I've read that browser security is the restricting factor in this but
changing all of my security settings in IE to low didn't seem to affect
it (not sure what the equivalent of security settings is in Firefox).
Does anyone know of a way to link to local files directly in a way that
lets you open them directly from the source instead of by downloading
them to a temp file or saving the file to somewhere locally? Is it
even possible in PHP?

View Replies !
Download Files From Remote Server To Local Webserver
I am trying to create a php page whereby people can download files from a remote server to their own server (to update their webdirectory with updated files/images etc). So for example one php page (e.g. update.php) should be able to download files from a remote server to a specific directory on their local webserver. Is this possible?

View Replies !
Hyperlink From Intranet Web Page To Local Files On My Computer
I'm creating a company intranet, and every employee has certain
program we want them to be able to run from it, meaning we want the
link to the program to be on the intranet page. For example, Adobe
Photoshop resides on all the employees computer under "C:Program
FilesAdobePhotoshop 7.0Photoshop.exe"

However, when I enter that as a hyperlink on the page, it does not run
the program.

Is there a way to get a web page to run a program on the local host?

View Replies !
Problems Uploading Files Using Apache And Php On A Local Windows PC.
I've got some problems uploading files using apache and php on a local
Windows PC. I'm using the file upload example from the manual, but i
can't get it to work. I don't get an error message, it's asif nothing
happens. I can't find the file that should be uploaded on my harddisk.

Has anyone a working example for file-uploads on a local server with
the settings for the php.ini file? Any tips?


View Replies !
Making A Database Backup To Local Server And Upload Files To Another?
I want to make a script that backups the *.frm and *.MYD files to my server and I also want to upload those files to another server via FTP? I have a copy of the database files in the directory, that works fine. But my ftp part doesn't! PHP Code:

View Replies !
Multiple Php.ini Files?
I am going to be hosting a site that uses SJIS(Japanese enc-type) as the default encoding, Japanese as the default language, etc., in php.ini. The problem is that there are other applications running on the server.

There are concerns about the swap of default languages affecting the other applications and I was wondering if there is a workaroud. Can I use multiple php.ini files, can I direct a default language to a certain site?

View Replies !
Multiple Php.ini Files
I have a site working quite well using php on my server (win2k, IIS). Now I need to clone the site for another association, with a different domain, etc., on the same box. I have copied the files I want to the new folder, but I soon discovered that my includes are still coming from the first site, per the path statement in the php.ini file. I have scoured the net and devshed and haven't found something that will work elegantly enough.

Bottom line: is there a way to specify a specific php.ini file per site in IIS? If so, what is it? Out of the box PHP likes the php.ini to be in the windows directory.

Yes, I could do a work-around of specifying a static path to my includes, but I want to be able to copy files from one domain to another without having to edit them first. If everything were in one directory it would be fine, but of course I use subdirs, etc.

I guess another way to word my question is: how can I have multiple sites on one box using PHP, so that pages can be moved from one site to another without having to edit them so they use the correct include files?

View Replies !
Ftp Multiple Files
I am very new to PHP scripting and need some ftp assistance. Here is what I need to do: remove old backup files from local directory, open connection to ftp site, download all the files in the directory for today's date, then run a restore script for all the files just downloaded.

I have got everything covered except for how to download all the files in a folder. I just read that there is not php function equivalent to mget.

The folder name is today's date, such as "2006-08-11", and the files within that folder are named "test1_2006-08-11.tar.bz2", "test2_2006-08-11.tar.bz2", and so on. There are about 75 files total.

View Replies !
Upload Multiple Files...
this is my coding for uploading multiple files...the
problem is..i want the files that i have been upload will show in the
same page but using only one text box..

<HTML>
<HEAD>
<title>FILE UPLOAD</title>
<body bgcolor="magenta">

<form method="POST" ENCTYPE="multipart/form-data"
action="uploadfile.php">

<p>
Files:<br>

<input type="file" name="uploadFile" size="40">

<br>
<input type="file" name="uploadFile2" size="40">
</p>
<p>
<input type="submit" value="Submit">

<br>
<br>
<?php

// Where the file is going to be placed
$target_path = "uploads/";

/* Add the original filename to our target path.
Result is "uploads/filename.extension" */
$target_path = $target_path . basename( $_FILES['uploadFile']['name']);

$_FILES['uploadFile']['tmp_name'];

$target_path = "uploads/";

$target_path = $target_path . basename( $_FILES['uploadFile']['name']);

if(move_uploaded_file($_FILES['uploadFile']['tmp_name'], $target_path))
{
echo "The file ". basename( $_FILES['uploadFile']['name']).
" has been uploaded = ";
} else{
echo " ";
}

$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['uploadFile']['name']);
$target_name = basename( $_FILES['uploadFile']['name']);
$dir=" ";

echo "<a href='{$dir}/{$target_path}'>{$target_name}</a><br />";

// Where the file is going to be placed
$target_path = "uploads/";

/* Add the original filename to our target path.
Result is "uploads/filename.extension" */
$target_path = $target_path . basename(
$_FILES['uploadFile2']['name']);
$_FILES['uploadFile2']['tmp_name'];

$target_path = "uploads/";

$target_path = $target_path . basename(
$_FILES['uploadFile2']['name']);

if(move_uploaded_file($_FILES['uploadFile2']['tmp_name'],
$target_path)) {
echo "The file ". basename( $_FILES['uploadFile2']['name']).
" has been uploaded = ";
} else{
echo " ";
}

$target_path = "uploads/";
$target_path = $target_path . basename(
$_FILES['uploadFile2']['name']);
$target_name = basename( $_FILES['uploadFile2']['name']);
$dir=" ";

echo "<a href='{$dir}/{$target_path}'>{$target_name}</a><br />";

?>
</form>

</body>
</HEAD>
</HTML>

View Replies !
Removing Multiple Files
We are trying to remove multiple files (with different extentions) and having some PHP syntas troubles:

unlink("..$dir/some_string.*");

does NOT seem to work! In other words, we are trying to 'imitate UNIX rm some_string.*

View Replies !
Searching Multiple Csv Files
what I have is a directory of csv files. All containing customer related info and all formatted exactly the same. What I want to do is loop through the directory checking each file for certain info and displaying how many times it is found per info.

The info would be called initials and is the 4th coma in the file.
It would be cool to be able to grab the set of initials and list how many times each set of initials is found.

so my initials would be listed: WFN was found 16 times. and so on for the next set of initials. So it would list the initials found only once and then increment next to them, I guess. Anyone know how to do something like this? I hope everyone understands my question.

View Replies !
Submitting Multiple Files!
I am building a page that submits an article with 9 jpgs images of 45 to 60ko in size.
I got it working with no problems for two to three files, until when I tested with all nine images I saw the real problem, that wouldn’t uploaded it.
When I consulted with my service provider they said they have put a limit to upload of 200ko per submit.

Here I am stuck with no real solution to this problem, except that I have this idea of submitting the article by breaking it down in 3 steps and by presenting three different forms which should be ok, but what will I do if the person wanted to edit the article after having submitted e.g. to modify the article later on.

How will I go fetching the article and presenting it in 3 steps, but this time for update and taking it into consideration of the images stored in the file and referenced in the db.

View Replies !
Read Multiple Files
I have a PHP script where I read parts of xml feeds from multiple web addresses and display data. Something like :

for(){
$filedata = @file(url);
parse xml -> display data
}

My problem : can I read more files at once (multithreading?) - because it seems to work very slow now.

View Replies !
Uploading Multiple Files W/ Php
I can't figure out how to upload multiple files. I have the form w/ 2 upload fields called image1 and image2. Then I am using this script which will upload the file names to a database and it will upload the first file to a folder on the site called "propertyimages/" and I need to know how to make the script also copy the other file to the folder. here is the script, which contains some additional information being submitted to the db: Code:

View Replies !
Upload Multiple Files At Once
I was on website that showed all folder on my computer in a sidebar. when i selected a folder all the files showed in a text area next to the directories. with a checkbox that could be selected and up loaded.

View Replies !
Download Multiple Files
I have lots of images on my site, and even if they are compressed and small it takes a lot of HTTP requests and slows download time.

I found a script for ASP which allows someone to download a page as a single http request.

View Replies !
Uploading Multiple Files Together
I want to know that is there any way that I can upload various files by pasting the urls of files together without writing the urls in separate boxes by changing some codes?

My script gives me option like this ...

View Replies !
Uploading Multiple Files
At work one of my tasks for the site(being created in php) is to create a file uploader where people can select files to upload to the site. The problem is with this site a user could potentially be wanting to upload over 100 files at any one time, may be several hundred.

However as I'm sure you know html file uploaders only allow one file to be selected at once. so for over 100 files this would be incredibly time consuming. Then I thought if there's a list of files entered into a text box it would be possible to preload lots of file fields with this data - but nope it seems like you're not allowed to use the value tag to set file fields like you are with normal text inputs.

View Replies !
Printing Multiple PDF Files
We have a system where we store link information for PDFs in a database. Recently, we've been given a request to add checkboxes next to each form, so that rather than printing each form one at a time, a user can place a checkbox next to the forms they want and then click a button to print those forms.

Anyone know of a good solution for this? My current idea is to somehow merge the PDF's together in a temporary file and then open in for printing.

Any other solutions for this kind system? Where the user can select multiple PDFs to print?

View Replies !
Multiple Files Compressed With GZ?
GZ files can contain multiple compressed files inside them, as I understand it. How can we create them when writing GZ files? Goal:

1 GZ file called compressed.gz containing two files, one called A_file.txt and another called B_file.txt

Flawed code:

//files
$GZFile='compressed.gz'
$fileNameA='A_file.txt'
$fileNameB='B_file.txt'

//data
$stringA=?'
$stringB='abcdefghij'
.................

View Replies !
Open Multiple Files
I wish to convert my static website to a database. I can do this fine with regular expressions, but the problem I am having is opening more than one file. I have about 2000 html files which look like

/1411-Web_Prince-data.htm
/1714-Just_help-data.htm

I have a website that lists all these html files, I only need help to open these html files one by one? I will then strip the data I need from it using regex.

View Replies !
Parse Multiple XML Files
I'm using the following code to parse an .xml file, although I need a way to do multiple files at once. Is that possible?

<?php

$request = 'file.xml'

// Fetch it
$response = file_get_contents($request);

if ($response === false) {
die('The request failed');
}

// Create a new DOM object
$dom = new DOMDocument(&#391;.0', 'UTF-8');
..................

View Replies !
Copying Multiple Files
I am trying to copy multiple files with this code I found at php.net

<?php
$file = 'example.txt'
$newfile = 'example.txt.bak'

if (!copy($file, $newfile)) {
&nbsp;&nbsp;&nbsp;echo "failed to copy $file...";
}
?>

but when I try to copy multiple files, it only copies the last file in the list.

What can I do? I have read about creating your own functions, but I don't really understand the 2 examples I can find.

View Replies !
Downloading Multiple Files
I can't figure out how to get my PHP page to downlaod multiple files. Where I work the is a regular requirement to extract a load of data from an Oracle database, manipulate it and upload it to another system.

Unfortunately, the second system has been designed to only do this in batches of 250 whereas the usual output from the Oracle database is in excess of 5000 records for most of our customers.

This means splitting the output up in to batches of 250 records, saving each file as customerid batch x.csv and then uploading it to the second system. Code:

View Replies !
Zipping Multiple Files
i am working on a php page, process_extract_papers.php, that helps to zip documents for me. One problem i faced was that when the documents are more than 20mb, the system will fail and thats because it exceeds the temp directory memory. And instead of zipping one big file, i want to zip multiple files instead. Firstly, it will be much easier to download. The problem is that i managed to zip the first file and able to download it. So get the next part of the file, i will need to press a button called Extract Next. However, even though i did that, when i press start download button, i will still be downloading the first file.

View Replies !
Scanning Multiple Files
I was wondering could this be done. Basically I want to open then scan 3 files for a string. Then do something based on what file the string was in.

View Replies !
Upload Multiple Files
whats the best way to upload multiple files, as in more than 30 a time, using php, can you ftp a folder and get php to read file names etc then store it in a db? how do you dynamically add multiple input files to a page then make the moveuploadfiles code work dynamically aswell.

View Replies !
How To Upload The Multiple Files With Using One Browser
how to upload the multiple files with using one browser show the
multiple files in the same page?

View Replies !
Zipping Multiple Files Using Gzencode
I'm successfully using gzencode to zip a file using the following code ala the documentation: PHP Code:

View Replies !
Php Template For Multiple Text Files
I have over 800 text files. I need one php template webpage that can pull in text of requested file on request in url. Example:

http://www.gothinia.com/chronicle/epos.php3?title=Title_Of_Text_File_With_Story.txt

would place text of Title_Of_Text_File_With_Story.txt inside template called epos.php3
what code will do this in a simple effiencient manner?

View Replies !
Uploading Multiple Image Files
A user can upload maximum 10 image files at once.
When the user only uploads 6 images, 4 fileboxes are left blank. I use
function checkImage() //check the the extension. Must be a jpeg
{
$bool = 0;

$this->type = $_FILES['imagefile']['type'][$this->index];
if ($this->type == "image/pjpeg" || $this->type == "image/jpg")
{
$bool = 1;
}
else
{
$bool = 0;
$this->errorMessage .= "- Not an image ($this->type). Image has to be a
jpeg<br>";
}
return $bool;
}

to test the image.
I go from 0 -> 10. When it comes along a blank imagebox the function doesn't
return anything. Someone knwos why. Is there a better way to check for a
blank filebox that is send?

View Replies !
Zlib Multiple Files In One Archive
Is it possible to Zip up more than one file into a single .gz file using zlib? I have been trying the following code which does not seem to work: PHP Code:

View Replies !
Generating Multiple Files Using Templates.
I'm trying to develop a doorway page maker script, what I've done is that I've setup the script to parse a keyword.txt file into specific SE optimized templates, I have done this initial part with the script below Code:

View Replies !
Include Multiple Auto_prepend_file Files?
Our site uses some site-wide session management that requires an "auto_prepend_file" directive to handle. Now I'm building a set of pages that will require another auto_prepend_file directive... but it seems that PHP (4.0.6) won't let me specify more than one.

If I include two "auto_prepend_file" directives in php.ini, only the last one is accepted. And trying something like Code: auto_prepend_file = "/dir/file1.php:/dir/file2.php" doesn't work at all. So did I get the syntax wrong, or is that really something PHP4 doesn't support?

I suppose I could put something like "require(file2.php)" at the end of the first auto-prepended file, but that's a messy solution I'd like to avoid if I can. Are there any other possibilities?

View Replies !
Upload Multiple Files In Outlook
If you want to upload multiple files in Outlook you just highlight the ones you want and then attache them. Is it possible to open a file dialog box to search for files and then click the open button to attache the paths to send the files to desired storage file. With HTML input type of file, it only allows one pathway to be selected and entered into the textbox. Is there a way around this?

View Replies !
Upload Multiple Files With Only One FILE Box?
To make uploading pictures an easier process for my client, I'm looking to get rid of the 10+ upload file boxes I have, and replace them with one, but for her to be able to select as many files as she wants.

View Replies !
Uploading / Downloading Multiple Files
I have a database "planitteacher" into which I would like to create a table that will allow me to put in the following:

Title
Description
Subject
Age Group
Date added
Email
File - This may have multiple files attached.

Basically the db is goign to be for teachers to share lesson plans with each other.  they can upload information about the lesson along with multiple files associated with the lesson such as images, PDF, DOC fiels etc.

I have already figured out how to make one form that uploads information to a test table called "uploads" and the code looks like this: Code:

View Replies !
Upload Multiple Files From One Form.
I want to upload multiple files from one form. Each file is to go into a separate database table. So any ideas how this is done? My code so far is below but it can get very large and messy. Could I use an array or something to make the code easier to use? Code:

View Replies !
How To Save Multiple Generated Pdf Files?
For accounting purpose, I have a result page which gives a list of links of invoices beside other values of orders. Each invoice link is generated PDF on the fly.

The produced link is like, i.e. 'invoice.php?order_12903'

Is there anyway that during this page is loaded, it will save all the pdf invoices in some said directory either as pdf or zip? Or in this page, there will be 'SAVE' button, by using that all those pdf invoices will be saved!

View Replies !
Replace Command On Multiple Files
I would like to execute the same replace command on multiple PHP files. Any ideas of what software can do that?

View Replies !
Any Way To Upload A Whole Directory Or Multiple Files
is there any way I can select more than one file at a time, or a whole directory of files on my local system to upload to a remote server?

View Replies !
Hiding Multiple Javascript Files With Php
I found the following and it seems to work fine with one javascript:

http://www.developertutorials.com/tutorials/php/hide-your-javascript-with-php-050419/page1.html.

View Replies !
Upload Multiple Files At The Same Time Into A Directory.
I'm wondering if there is a way to upload multiple files at the same time into a directory.

View Replies !
Downloading Multiple Files From A Shopping Cart
I have a shopping cart style page that is suppose to carry over info about checked images from a previous page. (search page lists multiple thumbnails, you check which ones you want, and then proceed to another shopping cart page that lists your choices and is suppose to allow download all the files)

I suppose you can use HTML to carry out a download and listing the images into an array w/download links.

But this would be tedious if a person wanted to download 30 images (too many clicking). Is there a way that they can be downloaded all together or in succession with a click of a button (or just a couple clicks) ?

View Replies !
Creating Download Manager For Multiple Files
Has anyone run across some sort of download manager to be able to download multiple files at a time via http with PHP? I run a mp3 site and I would like to be able to allow people to download whole folders at a time basically the same functionality as ftp but with http. It would be kind of like the smart download thing that netscape has but cross platform compatible. Any ideas?

View Replies !
Upload Multiple Files Using PHP And VBScript Or JavaScript
Is it possible to use PHP with VBScript or JavaScript to upload multiple
files.
I'd like to automate the upload of a complete directory (not using FTP).
I don't need a common form with several upload boxes.

View Replies !
Fasttemplate Files Stored In Multiple Directories
If I declare in the script $tpl = new FastTemplate("/tmpl");

then I can use only template files in tmpl directory. What if I want to use template files in another directory in the same script? such as header.tpl and footer.tpl that are in another directory?

View Replies !
Downloading Multiple Files In Single Zip File
I am developing the project management system.

Each Project:
1. Title, description ... , stored in mysql database
2. Upto ten files (initial description), (name in db, file in file
system)
3. Message board, stored in mysql database (1 file per message, message
in db, file in file system)

I need a link (Download Project) which will download all the project
related files, description, message board in the single zip file.

View Replies !
Use .ini Files To Strore String In Multiple Languages.
for i18n. why do some apps like joomla tend to use .ini files to strore string in multiple languages. why not just use a php file containing the strings and store it i unicode format just like the .ini file is stored in unicode format?

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved