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.





Include Text File From Local Computer


how do i "include(file.txt); if i have it stored on my computer for security reasons or do i have to upload it to my domain.




View Complete Forum Thread with Replies

Related Forum Messages:
Include A File That Is Online - Not Local
Someone asked me to include one of their php files in my code that is hosted on their server. I have done this like so:

include("http://www.somesite.com/level2/includes.php");

$info = return_user_info($_COOKIE["provident_email"]);

echo $info['Last Name'];

But i get this error: Fatal error: Call to undefined function return_user_info()

Is this even possible? Or do i need to store that include.php file locally?

View Replies !
Automaticaly Upload A Text File From The Visitor's Computer
I've been trying to create a page (http://www.mysite.com/update.php), where when it is loaded, it will automaticaly upload a text file from the visitor's computer (file will be on the HDD (c:ap_definitions.txt)).

I have been searching for the code for 2 days, and can't find any upload script that doesn't use the $_FILE box.

Is it possible to automaticaly upload c:ap_definitions.txt to ap_definitions.txt on the server?

View Replies !
Reference A File On My Local Hard Drive As A Include?
I know this is probably a very dumb question with a very easy answer (and yes, I did Google it - it's probably just so self explanitory that no one's ever had the occasion to ask before. Can I reference a file on my local hard drive as a PHP "include?" I realize that simply by virtue of the fact that PHP is a server-side languge, the answer is probably "no," but I like to be told "no" rather than just assume it.

The guts of the file I'm working on live on my local machine, and I just need to get it through the PHP script on the server... Rather that go through the extra step of uploading the file to the server and then running it through the PHP script, I just thought it would be nice if I could cut out that middle step.

View Replies !
Parse PHP On Local Computer
Running Windows XP (Home) and would like to be able to parse PHP locally without having to upload files to my host server and view them there. I know I can install PHP on my PC, but what is the simplest way to set it up as a local server, preferably without needing to install Apache as well?

View Replies !
Check Local Computer Script
I am trying to do is create a script that searches the local computer of the user and if a filename is there, it will upload it to the mysql database.  Then, another script that searches for a filename on the database and if it's there, to ask the user if they would like to send it to their local computer.  Any suggestions?

View Replies !
Way To Select A Directory On Your Local Computer
Is there a way to select a directory on your local computer and automatically upload all files in to your server?

View Replies !
How To Upload Website From Local Computer
i have made my website on my local computer. and now i'm trying to upload it into server. but some errors happen, and these errors aren't show up in my local computer. please give me suggestion about making website in local computer and then uploading it.

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 !
Saving Email Attachments To Local Computer
I receive a daily email attachment, which is a zipped .csv file. I am trying to write a script that is able to read this csv file. Currently I am using the IMAP function and I am able to access my mailbox and get the name of the attachment, but this is where I've hit a stopping point.

Is it possible to save the attachment to my local computer? From there I could use the zip_read function. I have tried file_put_contents, but that doesn't seem to work because of the .zip format.

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 !
How To Populate HTML Table From Local Text File.
I am looking for a way to populate an HTML table from an external
local text file which looks like this:

DATE/TIME LAT. LON. DEPTH. ML.
-------------------- ---------- ---------- ------- -------
21/03/2005-04:06:03 XX,XX XX,XX 171 3,42
21/03/2005-12:23:53 XX,XX XX,XX 500 5,4
21/03/2005-12:43:10 XX,XX XX,XX 553 5,38
21/03/2005-18:47:51 XX,XX XX,XX 162 3,91
21/03/2005-19:29:49 XX,XX XX,XX 500 3,51
21/03/2005-20:04:51 XX,XX X,X 75 3,72

The file could have more rows (DATA) that I show here. The file is
provided to me on a daily basis and I have to update a web page daily
with the contents of the file.

I considered using JavaScript embedded in the HTML page but I am a
newbie on what scripting for the web it refers.

How can I populate the HTML table with this text file which changes
everyday.

Also, is it possible to use php client-side only, without a server?

View Replies !
Passing Form Data To An Email Address/Excel Sheet On A Local Computer
I am right now learning PHP & want to know if there is a way to send
web form data to an Excel sheet located on a network. My windows xp PC
doesnot have a copy of Excel. Also i am not connected to the internet,
its a local computer.

What i am trying to do is to make a PHP script which will send a simple
form data to an excel sheet (or create a new Excel sheet) on another PC
on a network.

Since i am not connected to the internet, i will not be able to send an
email (anyway, sendmail is not available on Windows OS), nor do i have
any server on windows.

Is it possible to send form data to Excel sheet on local computer? Even
my PC is a local PC. Some one was saying its possible thru Windows
Scheduler.

View Replies !
Could Not Start MySQL Service On Local Computer. Error 1067: The Process Terminated Unexpectedly .
Im getting this problem when i try to start mysql server when i try to right click and select 'start the service'...the lights

still red...i try to went MyComputer>Manage>Services and Applications>Services

i try to start mysql on properties...prompt error came out and says "Could not start MySQL service on local computer. Error 1067: The process terminated unexpectedly" .

View Replies !
Search Script - Warning: Include(usr/local/lib/php/index.php) [function.include]: Failed To Open Stream:
A while ago I installed a script. It all worked just fine untill my host upgraded the servers. Since that moment I have an error message when I try to do a search.
This is the error:

Warning: include(usr/local/lib/php/index.php) [function.include]: failed to open stream: No such file or directory in /var/www/g28894/planthunteronline.com/HTML/directory/links.php on line 13

Warning: include() [function.include]: Failed opening 'usr/local/lib/php/index.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/g28894/planthunteronline.com/HTML/directory/links.php on line 13

Below I have added a part the script that may cause the problem (the complete script is to large to post). Please keep in mind that I am not a php programmer and I don't understand anything about it. I am just looking for a part of code that can solve the problem. Code:

View Replies !
Displaying Text With Include File.
Given this html code page;
======begin
<html>
<body>
<!--#include file="outing.1.shtml"-->
<form action="form.php" method="GET">
<input type="hidden" name="op" value="ds">
<table width="468" border="0" cellspacing="0" cellpadding="0">
<tr>
<input type="hidden" name="id[1]" value="1">
<td>Name<input name="name[1]" type="text" size="30"></td>
<td>Email<input name="email[1]" type="text" size="60"></td>
<td>Phone<input name="phone[1]" type="text" size="15"></td>
</tr>
</table>
<input type="submit" name="submit" value="submit">
</form>

</body>
</html>
===========end
and this php code page;
==========begin
form.php
<?php
if($_GET["op"] == "ds") {
foreach ($_GET["name"] as $key=>$value) {
echo $_GET["name"][$key] ."-". $_GET["email"][$key] ."-".
$_GET["phone"][$key] ."-". $_GET["id"][$key];

$fp=fopen("outing.1.shtml","a");
fwrite($fp,$_GET["name"][$key] ."-". $_GET["email"][$key] ."-".
$_GET["phone"][$key]);
fclose($fp);
}
}
?>
========end

Both of these are on my IP server, EV1.

I would like the contents of 'outing.1.shtml' to be displayed hence
the <!--#include file="outing.1.shtml"--in the HTML code.

View Replies !
Why Does Include File Text Need To Be Bracketed By <?php> ... <?>
Since the include function is called from within a PHP script, why
does the included file have to identify itself as a PHP again by
enclosing its code in <?php... <?>

One would assume that the PHP interpreter works like any other, that
is, it first expands all the include files, and then parses the
resulting text. Can anyone help with an explanation?

View Replies !
Include Part Of A Text File
I have a text document that stores text for use in a flash movie. I'm
also using PHP to displace the same text on another page. However the
text document includes 2 tags for use by the flash movie... title= and
&content= ... see text file at end of post ....

when i use the php command <?php include ("info.txt"); ?> it also
displays those tags. Is there any way to use php to just display what
apprars after the &content= in my text file.

I can't remove the tag begause it is required for the flash file
elsewhere on the site.

"
title=CDN HOME &content=The COMPUTER DONATION NETWORK is a resource of
new, used and refurbished computer equipment, software, networking gear
and lab furnishings for "

View Replies !
Passing Variables From A Text File Via Include()
what I'm trying to do is to make a sort of news posting script for a website that I've been working on. I am getting the text for the news from a form that the user fills out. The form has several different fields. For the sake of discussion, I'll refer to the values of these fields as

$title
$shortStory
$longStory

The values are then passed to a php file called write.php that will write the values to a file called news.htm, where the users will then be able to read the news. In order to make news.htm match the rest of the website, I've created a file called newsproperties.txt. This file holds 4 variables. It looks a little something like this.
PHP Code:

View Replies !
Extra Newlines In Output Text Added By PHP File Include
I have a simple PHP script that outputs a string requested by an Ajax
page. XMLHttpRequestObject.responseText as received from the PHP script
begins with 2 extra newline characters (

MyString):

<?php
require_once('DB.php');
require_once('../myDir/myFile.php');
.......
echo('MyString');
?>

myFile
<?php
$var1 = 1;
$var2 = 2;
$var3 = 3;
?>

If I manually write the contents of myFile.php into the script, there
are no extra newlines in responseText.
Am I missing something?

View Replies !
Load .txt File From Computer And Save The File In Www/folder Director
anyone know how to add the .txt file from computer into the localhost www/Myfolder directory.

View Replies !
/usr/local/include/expat.h:971: Error: Conflicting Types For 'XML_FEATURE_UNICODE'
While building PHP 4.4.0 on a fresh installed FreeBSD 5.4 I get the
following error:

www# /bin/sh
/usr/home/c/console/toolscon/web/2/php-4.4.0/libtool --silent --preserve-dup-deps
--mode=compile
gcc -Imain/ -I/usr/home/c/console/toolscon/web/2/php-4.4.0/main/ -DPHP_ATOM_INC
-I/usr/home/c/console/toolscon/web/2/php-4.4.0/include -I/usr/home/c/console/toolscon/web/2/php-4.4.0/main
-I/usr/home/c/console/toolscon/web/2/php-4.4.0 -I/usr/local/include -I/usr/local/include/libxml2
-I/usr/local/include/freetype2 -I/usr/local/include/mysql -I/usr/home/c/console/toolscon/web/2/php-4.4.0/ext/xml/expat
-I/usr/home/c/console/toolscon/web/2/php-4.4.0/TSRM -I/usr/home/c/console/toolscon/web/2/php-4.4.0/Zend
-g -O2 -c main/internal_functions.c -o main/internal_functions.lo
In file included from
/usr/home/c/console/toolscon/web/2/php-4.4.0/ext/wddx/php_wddx.h:26,
from main/internal_functions.c:53:
/usr/local/include/expat.h:971: error: conflicting types for
'XML_FEATURE_UNICODE'
/usr/local/include/libxml2/libxml/parser.h:1196: error: previous definition
of 'XML_FEATURE_UNICODE' was here'

How to solve this? Any ideas? what is causing the problem?

The configure line:

'./configure' '--with-apxs2=/usr/local/apache/bin/apxs'
'--with-mysql=/usr/local' '--with-ttf' '--enable-memory-limit'
'--enable-track-vars' '--with-gd' '--with-jpeg-dir=/usr/local'
'--with-tiff-dir=/usr/local' '--with-png-dir=/usr/local' '--enable-bcmath'
'--enable-versioning' '--enable-trans-sid' '--with-zlib' '--with-xml'
'--enable-gd-imgstrttf' '--with-mcrypt' '--enable-calendar' '--with-mhash'
'--enable-ftp' '--with-curl=/usr/local/include/curl' '--with-xml'
'--with-dom=/usr/local' '--enable-wddx' '--with-sablot=/usr/local'
'--with-expat=/usr/local' '--enable-xslt' '--with-xslt-sablot'
'--with-dom-xslt=/usr/local' '--with-openssl=/usr/local' '--disable-cgi'
'--with-freetype-dir=/usr/local' '--enable-exif' '--with-gettext'
'--with-bz2'

View Replies !
File Upload - Any Way To Get The Path Of The File On Users Computer?
Producing a html form with file upload. I am working on the error checking and when the page is submited, if their is errors on it I want the pathname of the image to remain in the html file box, so the user does not have to re-select it.

ie html form:

<input name="pictures[]" type="file" size="30">

I know you can get the name via

$_FILES['userfile']['name']


but is their any way to get the full path name?

I though PHP Code:

$_POST['pictures'][0]

ect might work but it doesnt.

View Replies !
Retrieving Text (include "file.php") From Mysql
im doing a cms with adminpanel where you can change 2 templatebits, "i_htmltopp" the top html file and "i_htmlbunn" the bottom html file. All my php is either in includes in the html top file or between the two html files.

the two templatebits are saved inside a mysql tabel called template, im fetching them from the mysql by running Code:

View Replies !
Opening A File From Your Computer
How would you open and read a php file that is in your hard drive and use it inside a php script that is run on a server. Example: security.php - file located on the server would have something like this PHP Code:

View Replies !
Write A File To The Computer
I need a way, in ANY internet language, to write a text file to the computer.

View Replies !
Read File From My Computer To Web Server
I want to know how to read a file from my computer and not on the web server. For example, I upload the script to my web server and view it from my home computer. How can I make the script read the file from my computer? I am wanting it to read the file and write it to a new file with the same name on my web server.

View Replies !
Write To A File On An External Computer?
Is it possible for me to write to a file on an external computer? I am building a site where i want the users to be given an unik id the first time they contact the site through a piece of software which i have developed. Their username is found in a settings file on their local harddrive and is sent to the server when they request infromation from the server. Now i want to be able to change the string in the settings file so that after the first request to the server it will contain their unik id as well.
Is this possible?

View Replies !
Error Says Can't See Include File, Yet Executes Some Code On Include File
I am using an include_once() command to include a file that sits a
level above the file view.php. when the code is run, I have an error
as follows:

Warning: include_once(../common.php) [function.include-once]: failed
to open stream: No such file or directory in C:Program Files..
view.php on line 2

Warning: include_once() [function.include]: Failed opening '../
common.php' for inclusion (include_path='.;C:Program Filesxamppphp
pear') in C:Program Files...view.php on line 2

The include command is simply: include_once(../common.php) - the '../'
before the 'common.php' to indicate a level above the current file
level. Is this right? I could not find a resource to confirm this.

The strange thing is that while the error seems to imply that the
calling file, view.php cannot 'see' the common.php file, other
functions called from the 'common.php' file executes correctly and on
the same calling file/page (view.php).

Appears to the a double take - quite confusing -

View Replies !
Problem With Getting Fullpath Of The Selected File From My Computer
I am working on php with html form input type file.i want to get the
fullpath of my file which i have selected from my computer.

example :C:programs.....

View Replies !
Include Text Files For Text Content?
Is it pretty standard procedure to use .txt files to store textual content on a big site? I have the content set up in the database right now, but management is a headache at best and I want a system whereby I can easily edit the content from a text editor or from a browser interface.

I can see the text file solution filling both of these needs, not to mention that in my preliminary testing it was almost twice as fast as calling from the database (even with good indexes). I just don't want to redesign my whole system only to find out that someone already tried it this way and it didn't work.

I also have a search page to worry about, for which I was planning on simply iterating through the files and checking each as I would a database entry. The search page is almost negligible, though. Not only does it not get much traffic, but we're mainly a catalog site, so anyone searching the site would likely be searching products anyway.

View Replies !
Browser Message To Open It In An Editor Or To Save It In My Computer For A Php File.
I've installed Apache + PHP. When I try to access a PHP script file via my browser, i get the typical message to open it in an editor or to save it in my computer, instead of open de file in the browser. Can anybody give me a solution?

View Replies !
Exporting Data From A MySQL Database To My Computer In CSV File Format.
I am interested in exporting data from a MySQL database to my computer in CSV file format.

View Replies !
Posting Local File Info To A Php File!
I have a script that I run locally and im trying to get the info to post to a php file so that I can view it in a browser. What I need to know is how to set up the receiving php to post it to the .html . Now I thought it went along the line of creating the php file and putting it on the root of the server then running the local script against a that php info file and it would dump the info to a browser but it wont work like that (I'm guessing cause it's a local script and not on the web)

I know this line is sending it to the .php in that directory but I don't know how to set up the receiving php I guess is my problem.

gosub phpsend www.xxxxxxxxxxxxx.com /xxxxx/xxxxxxxxx.php %sendstring

I guess what I need to know is whats the best way to post the received data to a browser after the script runs. Or to set up the receiving php file as for outputting it I can create the page I just need to know how to receive it .

View Replies !
How Can I Check File Type Of The Local File?
How can I check file type of the local file. The file is already uploaded.

View Replies !
Include (Change Include File Within The Page)
I am working on a website that requires the use of include files, i have the include html files ready and can properly show them in the page but I am looking for a way to have a menu on the page where the user can choose which file he would like to read,

I dont want to have multiple pages I would like to just have the actual php include code change when the user picks the file he would like to read. Anyone know of a way to do this?

View Replies !
Not Using Local Php.ini File
i have installed apache and php onto my computer a couple months back.. but for some reason, i still cant get local php.ini settings to be recognized (ie PHP is supposed to try php.ini in the folder your script is in before the default php.ini file. i simply cannot figure out why it isnt working. i've tried to get it to work a million times, and yes i've restarted. phpInfo() reveals that it continues to use the default php.ini file.

View Replies !
Writing To A Local File
We have a PHP/MySQL database application. A user would like to be able
to run a routine to read selected data from the database and export a
flat file to their local C: drive. After reviewing the documentation
and posts, it is not clear how to do this, or even if it is allowed by
the browser. If someone could point us in the right direction, we
would greatly appreciate it.

The application is hosted on a Linux server.
The users are required to use Internet Explorer running on Windows 2000
or XP (we also use VBScript).

View Replies !
Can I Launch A Local .bat File With PHP?
I need to write small web app that can launch a few .bat files from a local machine.
Is this possible with PHP, or would javascript be a better option? All i need to do is select the file (some HTML) then have a button to execute.

View Replies !
Check If A File Is Local
Is There A Function Or Method Which Can Check Wether A File Is Local.

View Replies !
Fopen() A Local File
I want users to use data from an excel file on there own PC. The URL of the file comes from an <input type='file' name='url' />

$file=$_POST['url'];
$handle = fopen ($file, "r") or die("Fout: bij openen van het bestand!");
$inhoud = fread ($handle, filesize ($file)) or die("Fout: bij lezen van het bestand!");
fclose ($handle);

If I try this i get an error "No such file or directory in ...mydomain..." But the file is of the form "c:file.xls" so he must not search in mydomain.

What am I doing wrong?

View Replies !
Write To Text File - Output The Result To A Text File
What i would like is to output the result to a text file Code:

View Replies !
Reading Local File Not On Server
I am trying to parse a file which is located on the users local drive and then take this data and put it into the mySQL DB. However, I get errors when I pass in a file path such as C:Documents and SettingsAdministratorDesktopfooSLInfo.txt.

View Replies !
Read File On Local Drive
lets assume that the sysadmin granted to read those files, what php functions needed? can u give me ur ideas how to do it?

View Replies !
How To Process A Local File Rather Than Just Read It
I can read a local file with

fopen("myFile.php");

However this gives me the source of the file (i.e. php code). I want
to get the results of the file after it has been evaluated (i.e. HTML).

The obvious way of doing this is

include 'myfile.php'

However, I want to process the evaluated result. For example:

echo htmlentities( include 'myfile.php' );

This doesn't work because the result of the include statement is true
or false rather than a string.

I'm sure this is very simple, but I'm just learning.

View Replies !
Retain The Local File Path
There is form with image upload. On error local file path becomes empty in file upload field. Is there any way to retain local file path in the file upload field. If some field in the form is empty. I am using server side validation of the form. So, on error form reload with error message.

View Replies !
Use The Include Statement And Include A File
When I use the include statement and include a file, it prints on the web page - these are functions that I call deeper into my web page. there must be a setting that is causing the functions to be displayed on the web page?

View Replies !
Include One Big Include File With All Functions
What is better, to include one big include file with all functions in it or
is it better to include several include files with each function in a
separate include file?

View Replies !
Include Text
I'm using the following code to display popups in a HTML window: code on main page:

<a href="javascript:;" onClick="MM_openBrWindow('../../window.php?image=mg/latehistorical/mga_concept.jpg','','resizable=yes,width=560,height=435')">

code on popup page:
<img src="<?php echo ''.$_GET["image"].''?>" border="0">

How do I include text on the popup page as well as the photo?

View Replies !
Writing A Local XML File From A Parsed URL? Similar To RSS
I am trying to pull the XML data from the following stream:
http://......and write it to a local file.

Actually, what I would like to do is take the above stream and display
it into a website... much like displaying RSS feeds on a webpage.

I looked at javascript, but someone there pointed me to the PHP group.
I may not have worded the subject correctly.

View Replies !
Copy Large XML Output To A Local File
I have a URL that when called generate a very heavy XML Feed like:

www.domain.com/generateXML.php?id=products

when i call this URL in the browser i can see a very long XML file generated containing different information..i want to copy this all output to a local file on my server so that i can use that file's info for different tasks on my site...PHP Code:

View Replies !
Selecting A File In Our Webspace From Our Local System
How to read a file which is in our webspace from localsystem in php.

View Replies !
Html Link For Local File Not Working
I tried a simple example for html link inside php file
I have a file called file1.txt inside C:

I put the following lines in a file and named it .html

<html>
<a href='C:file1.txt'> open file</a>
</html>
here the link works and the file opens upon clicking

if the same file I named it .php and tried to run it using apache localhost
here when you click the link, nothing happen and the file didn't open

why??

knowing that if we put any website link it works , but if we put any file inside our computer it doesn't work.

View Replies !

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