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.





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 Complete Forum Thread with Replies

Related Forum Messages:
Dynamic Web Page Link
I want to create a simple dynamic page where when i click on a link to automatically create the page. What i mean.. I have some news that display by date, and because they will be updated every day i don't want to create a page for each one of these.

So when the user goes to the index page of the news(where the news are displayed by date) and clicks on one, I want the php do all the job and create a new web page where it will add the hole text of the "new" the user selected in a page template. How do i do that? Can i use the dreamweaver templates?

View Replies !
How To Create Dynamic Page From Link
I'm practicing to understand and learn and have the following example. My page displays the state with the pet names under them, like this: Code:

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 !
Dynamic Menu Link Color Changer On One Page.
I have one issue i need a little assist on. I am using the PHP active link color change-hack from a list apart. The code is an instance like this repeated once for every link to a subpage in the menu: Code:

View Replies !
Dynamic Download Link - Not Direct File Link
I'm posting a podcast feed that makes reference to audio files for download. Instead of linking to the files directly (e.g. www.mywebsite.com/podcast.mp3), I want to link to the file as get variables so that I can track number of listeners (e.g. www.mywebsite.com/?audio=podcast.mp3). Where would I look to get something like this to work? How do I start sending audio data to the user using a link like this?

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 !
PHP-generated Link To Local File Doesn't Work When Clicked On. Why?
I'm running an Apache server on my own computer (Windows XP Pro).

I wrote a simple PHP script (called test3.php) that I'm running by
putting the following URL in the address bar of the browser (Firefox)
....

http://localhost/test3.php

The script generates the following link using the echo statement ...

<a href="file:///C:/pictures/xyz.jpg"> Picture </a>

("C:/pictures/xyz.jpg", as you can guess by now, is an image file on
my harddrive, but it's not in the document root).

When I clicked on the link, nothing happened. However, if I
RIGHT-click on it and select "Copy link location" (which copies the
URL to the clipboard) and then paste the URL into the address bar of
the browser, the picture then displays correctly.

Why did it not work when I clicked on the link the first time, but it
only worked when I pasted the link to the address bar?

Is there some special notation/syntax that I need to use to get this
to work properly?

View Replies !
Get GD Working On Local Installation - Unknown(): Unable To Load Dynamic Library
I just tried to get GD working on my local installation of PHP (under windows 2000). I copied the php_gd2.dll file into my WindowsSystem32 directory and uncommented it in php.ini, but it comes up with this when I try out any scripts....

Unknown(): Unable to load dynamic library './php_gd2.dll' - The specified procedure could not be found.

View Replies !
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 Replies !
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 !
Dynamic Link
"When the server starts TinCam also creates a file called 'ip.txt' wich contains the ip address. If your IP is dynamic (changes when you log on/off the internet) you can upload the ip.txt file with the On And Offline Upload function.

You can use this file to create a dynamic link to your images or video stream, using a server-side scripting language like ASP or PHP." i need to make a dynamic link that so when the ip address to the server changes the link changes at the same time. that way i will always have the correct ip address.

View Replies !
Dynamic Link Help
I have made it so that it is possible to change the color scheme of my website by using a form (uses cookies). This also changes the links and their rollovers - the only problem is I cannot get the links to work.

Im using CSS, Javascript and PHP/HTML to achieve what I have so far. Would it be possible to do this in just PHP/HTML and CSS i.e. have the style sheet variables change when the form is submitted on the PHP/HTML page and then have <a href> <a> tags and use mouseover and mouseout.

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 !
Dynamic Link/Content With PHP
I've created a mySQL database with the fields id, title and content.
'ID' is a unique field. Any ideas on how I can use PHP to generate a
list of the titles which are links. When you click on a link you are
taken to a page with the content held in the database. I'm guessing the
generated links would be something like /page.PHP?pageid=x based on the
id, that's if this script is possible at all.

View Replies !
Dynamic Link Prob.
header("Location: http://www.blah.com/mocks/functions.php/?id=".$res1['teamid']."");

This must be the wrong way to send this.

View Replies !
Creating A Dynamic Link
i want to do is to make each name a link that when someone clicks on it redirects to another page where all the entries stored in the jobs database are listed. So i need to make a query that takes the employer listing that u clicked and does a SELECT * FROM JOB WHERE employerName = employername. how i can do this?

View Replies !
Dynamic Link In Display.php
I am working through a few tutorials. I have managed to create dbupload.php,display.php, and edit.php. I'm now trying to link the display.php to the edit.php dynamicly via the UID field. Here's my latest failed attempt : Code:

print ("<td>" . $row '<a href="' . $row['http://www.mysite.net/edit.php?<?php UID ?>'] . $row['UID'] . "</a>" . "</td>");

I have that will really show my ignorance is "print" or "echo"? How do I determine when to use wich?

View Replies !
Create A Dynamic Link
I need to create an RTF document with PHP. Actually, I am using an already created RTF document which with strings like %var% that I replace with $var before sending the document. I need to create a link like http://www.example.com/id_content=125 but my problem is that in the document produced :

I can read http://www.example.com/id_content=125 But if I click on the link it goes to http://www.example.com/id_content=%id_content%

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 !
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 !
Dynamic Image/link Presentation
I am now trying to convert the following html into dynamic php to generate 9 images per page. How can I go about this by reading the images and associated links from a mysql database, using a previous/next link at the bottom. Are there any good articles around on this: Code:

View Replies !
A Link That Updates Dynamic Data
What I'm trying to do is have a webpage that updates the dynamic data from a database based on what links are chosen on the left side of the page.

- On one side of the page is a list of links. (ie: potato, carrot, apple...)

- On the other side of the page is a bunch of dynamic data that connects to a MySQL database.

Depending on what is chosen on the left side of the page, it will show the user that information from the database on the right side. Example:

If you click on the apple link, it pulls the apple row out of the database and presents a picture of an apple, gives some information on an apple, etc.

I don't think this is very hard but I don't see it in any of the books I have, and have never done it before. Can someone help point me in the right direction or tell me how this is done?

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 !
Using Preg_replace To Add Rel="nofollow" To A Link Based If Its Not The Local Domain?
I am trying to use preg_replace to add rel="nofollow" to a link and am having a difficult time with it due to my regexp abilities. The way I am currently doing it is i read the string into a variable and then explode with <a href=.

I then compare each array element for whether or not it contains my domain and if it does not then i do the preg replace. I am sure there is an easier way of doing it, but I do not know how. Can i just use a regexp in preg_replace to conver the string if and only if the domain portion does not match a certain string?

View Replies !
Highlight Active Link On Dynamic Pages
I am trying to customize a site that is I quess what you would call dynamic. The tool creates pages, but there are no real pages all stored in the database. The pages are all index.php....pageid=1, etc. Code:

View Replies !
Converting Dynamic Link Containing Numbers To One With Keywords?
I am trying to figure out how to convert my php site links from this (example using golf balls)

www.mysite.com/items/index2.php?item_id=10&

to

www.mysite.com/items/nike-golf-balls.php <--(or .html)

I am sure there is a post in here somewhere but I am getting cross eyed!

View Replies !
$PHP_SELF - Create A Link Which Refreshes The Current Page, And Based On Certain Items On The Page
On a page, I want to create a link which refreshes the current page, and based on certain items on the page (simple form objects like radio buttons)the page will load differently. My link looks like this: PHP Code:

View Replies !
Changing Dynamic Link URLs To SE Friendly With Preg_replace
I'm attempting to change a series of dynamically created links to more SE friendly links using preg_replace.

The code works great... except when I try to use a hypen in the URL as opposed to an underscore. It falls apart. Any ideas? Code:

View Replies !
Page Redirection - Link Index.html Page To A .php Pag
I have an index.html page with a link to a .php page This is the complete code of the .php page Code:

View Replies !
Open Dynamic Image Link To Certian Sized Window
I want to be able to open the pop-up images in a browser window sized the same size as the image. Could I add something in the header info? Code:

View Replies !
Can't Read Remote Web Page From Local Apache/PHP
I'm trying to read the contents of any Web page on another
host. I'm finding that...

echo file_get_contents( 'http://www.php.net' );

.... works fine if I upload the PHP script to my Web host, and run it
there. But if I run it on my PC, which is running Apache 1.3.33
(Win32) and PHP 5.0.5, then it always times out, and gives me the error
message...

[error] PHP Warning: file_get_contents(http://www.php.net) [<a
href='function.file-get-contents'>function.file-get-contents</a>]:
failed to open stream: A connection attempt failed because the
connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to
respond.

I get the exact same results using...

$fh = fopen( 'http://www.php.net', 'r' ) or die( $php_errormsg );
while (! feof($fh)) {
$page .= fread($fh,1048576);
}
fclose($fh);
echo $page;

Anyone know what could cause this to happen?

View Replies !
Connect Page (local) To Remote Database:
I'have Easy PHP in localhost and i need connect php page (local) to remote
database:

$db_host = "62.149.225.23";
$db_user = "gfo";
$db_password = "gfo";
$db_name = "gfonline";
$db = mysql_connect($db_host, $db_user, $db_password);

The browser show this message:

Warning: mysql_connect(): Can't connect to MySQL server on &#3962;.149.225.23'
(10061) in e:phpgfonline.itprovaremoto.php on line 7

View Replies !
How To Print The Local Variables Used In A Generated Page
I am still a beginner of PHP, and while I found out the way to print
all the variables passed as a POST, I was wondering (for debugging
purposes) if there is a simple way to tell the PHP interpreter to print
out all the variables that have been used during that session, without
storing anything anywhere, and without buying a commercial tool.

View Replies !
Setup A Link In My Page That Will Change My Page
I am working on a page with a right column that I want to use for
navigation. In this right column I am using the below code to set a
value for the link. I am using the variable $test right now.

I want to click on the link and when the value is set to a certain
value, say 1, I want the script to run and load a page based on a
switch case. This way I can use different links for navigation that
will load different forms and areas of my application. So here is the
code for the link line. Code:

View Replies !
Redirect Page On Remote Web Host When Local Server Is Offline
Hope some one can help . I have my web site hosted on powweb (my remote web host)and I want a user to be redirected when they access my local server through a link on my remote web site to another page on my remote web site when my local server is offline.

View Replies !
Link Two Txt Files Together To Create One
I have two text files. They both have an ID that is the same. One file has an ID and a phone number. The other file has the same ID, a different ID and extra information. What I am trying to do is link one file with the second file to create one file. Problem is I do not know how to do this. I am a beginner at php but any and all help would be great. Code:

View Replies !
Update Link Files
I have a really headache problem, i have 2 websites, one stores information like site1.com and the other stores data like site2.com.

People from another site always stealing my data links and linking to there sites, i have tried to using htaccess but it doesn't work for wma, and wmv files.

i'd like to rename the folder where i storing data in site2.com every day, but then my data in my site1.com will have to update links, this is too many links in database, i can't update it all at the same time. Code:

View Replies !
Php Page Will Not Process Link To Different Page
I have just installed RH Linux ES 3.0 (basic) kernel 2.4.21-9.EL, i686,
Apache 2.0.X, and php 4.2.X. I have made no changes to the php.ini.

I am trying to use the following page (code listed here) to click on
link, and display 1 of three pages. The code does not seem to work, it
only shows the "else" condition of the php code, which is page:
"stuff.php". What do I need to do to my apache/php config to get this
to work? Of course I copied this code from a php site tutorial somewhere.

Page code below:
<?
if ($link == page2){
$page="files/page2.html";
}
elseif($link == page3){
$page="files/page3.html";
}
else{
$page="files/stuff.php";
}
?>
<html>
<head>
<title> index.php </title>
</head>
<body bgcolor="#999999">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td colspan="3"><h1>The Template (index.html)</h1></td>
</tr>
<tr>
<td align="center" valign="top"><a href="index.php?link=index">
Page 1 </a></td>
<td align="center" valign="top"><a href="index.php?link=page2">
Page 2 </a></td>
<td align="center" valign="top"><a href="index.php?link=page3">
Page 3 </a></td>
</tr>
</table>
<? include($page); ?>
</body>
</html>

View Replies !
Hiding Video Files With PHP Link
I have a music video site and I want to be able to hide my files from theives who would link to them and run up my bandwidth.

This site uses PHP to this effect: ...

View Replies !
Concatenation Of Files To 1 Download Link
I would like to put download links on my website that would kick-off a PHP routine that would "feed" the contents of several files. On the user end this needs to create a single downloaded file.

I'm actually concatinating several MP3 files together (same bit rate, of course) for file downloads and podCasts.

I could easily do the concatination ahead of time but it's doing it in real time that has me stumped - in effect, streaming the download.

View Replies !
Download Link For Exe Files Dont Work!
i'm developing a php app that shows folders and subfolders with their content so someone can download files from those browsers. the problem is: the download does not work for exe files!

http://www.scotland.ca/dmspro/_uplo...4Std_Manual.PDF
works and
http://www.scotland.ca/dmspro/_uplo...-%20netants.zip
works too! but
http://www.scotland.ca/dmspro/_uplo...ils/wrar320.exe
and
http://www.scotland.ca/dmspro/_uplo...ISO_v6_5_en.exe
do not work!!!

where could be the problem there??

View Replies !
Include() Not Working Cannot Link To External Files
I am trying to set my db connection in another file and folder than my main index.php. When i include the db connection in the index.php everything works fine. but when i uses include ("include/config.php"); all that happens is the php code gets displayed.

I have one script where this function actually works, but every other script i have ever tried to use has this problem where i can not use inlcude to link to an external file Is their something wrong with my php.ini config

View Replies !
Display A Link For Users To Download Files?
I've created an area where users login and can upload files to a folder above the Doc Root. How can I display a link so that if needed, users can download those files?Currently I have PHP Code:

echo "<td><a href='{$uploads['file']}' target='_blank'>
                {$uploads['title']}<br />
                </a>";

The table is 'uploads' and the field is 'file'. The display works correctly; however, the link of course goes to www.sitename.com/var/www/uploads/filename.ext as the 'file' field simply holds the file path and name.

View Replies !
Dynamic Links To Files In Same Directory
is it possible to make a php file for instance in my localhost htdocs folder and code is so that it automatically and dynamically displays links to all php/html files in that same directory when i hit it up in thew browser?

View Replies !
Generate Dynamic PDF Files On The Server
I tried to use HTML2FPDF to generate dynamic local files and save the generated files on the server. I don't know why it gives me the following error message:

" Warning: fopen(gen_pdf/gen_pdf/yan.pdf) [function.fopen]: failed to open stream: No such file or directory in /export/home/.../pdfCov/fpdf.php on line 1698 FPDF error: Unable to create output file: gen_pdf/yan.pdf "

I cut and paste the following part of the code into a test.php file and run it. the test file can generate text file without any problem: ...............

View Replies !
IP Address From Log Files Looks Dynamic With Same Visit.
The log files for my web site have visitor's IP address where the third and fourth columns change for the same visit.

I thought that for a dynamic IP address it was supposed to remain fixed until they disconnected from the Internet - not change or rotate during the visit.

I'm not an expert at reading log files but it looks like the third and fourth columns will change for the log file lines even for just one page.

Are the changing IP addresses caused by a web bot or does the IP address sometimes change during the visit for real visitors?

View Replies !
Include Files Dynamic Content From Subdirectory
I am trying to use different (dynamic) content based upon the choice in a simple menu, here is what I have so far (see below), it works fine as long as the include files (a.inc, b.inc, etc...) are in the root directory, what I want to do though is keep all the include files in a subdirectory called includes, I am not familiar enough with PHP to change the code to make this work. Code:

View Replies !
Use Multiple XML Files To Create Dynamic Form?
I have multiple XML files which each contain a question and an answer for a department. I want to keep them separate so that each department can add to their questions/answers as new ones come in. Code:

View Replies !
Next Page Link
I have pages, 1.php, 2.php, 3.php and so on. I would like to make a next page and last page links at the bottom of each of them. Is there a way to get the pagename then take the .php off of it, and then add or subtract 1 and then echo that?

$nextpage = "(php_self - .php + 1)";
$lastpage = "(php_self - .php - 1)";

I know that is not even close, but use that idea.

View Replies !
Oracle Spooled Files And Decode To Dynamic Pages
As a bit of a PHP newbie I have a question. On our Intranet we have
staff listings which we want to move to dynamic pages. As part of the
SQL in the original pages we have a SQL decode (see below...)

I have been trying to replicate this approach in PHP but have come
across no logical solution. I am assuming that there will be a PHP
based solution? Code:

View Replies !
Print A Dynamic List Of Files To Seperate Divs
I have a database table of files which fall into different categories. Each category has a numerical value.

I want to seperate the files into the correct <div> tags based on their category so I can then show and hide the <div> depending on which category is selected in a dropdown. It sounds easy enough but I can't seem to think right now and Im stuck.

So I would a have a string for each category. To this string I add the file information for each file in that category...and then print the strings..

View Replies !

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