Hi guys, I'm a newbie here looking for some help with my PHP.
I've created a button which will allow the user to click on, that popups the explorer window enabling them to navigate to a file and, in turn, open that file in a specified piece of software.
I've made it possible to click a 'browse' button and then browse for a file to upload, but is this other way possible?
I would want them to be able to navigate and select a '.kml' file that will open using Google Earth
Cheers
Open a file using PHP
Moderator: General Moderators
Re: Open a file using PHP
Is the file they will be opening on the server or the client?
Fellow newbie who keeps having to wrap her brain around where and when the php is actually being executed...
Fellow newbie who keeps having to wrap her brain around where and when the php is actually being executed...
Re: Open a file using PHP
it is all running just on my machine so I am essentially the client and server....using WAMP server to run it.
Re: Open a file using PHP
anybody got an idea as to how i can achieve this?
I have heard of and looked into php file manager but this doesnt make any sense to me.
cheers
I have heard of and looked into php file manager but this doesnt make any sense to me.
cheers
Re: Open a file using PHP
Paste up the code that you do have that works and we can take a look and see where the problem lies. It almost sounds to mee like you need to set file associations on your machine if they are browsing files and opening them on your computer.
- afr_dnf2011
- Forum Newbie
- Posts: 14
- Joined: Mon Mar 21, 2011 8:20 pm
Re: Open a file using PHP
the following code may help you.
Code: Select all
<?php
$txt_file = "file1.txt";
$f = fopen($txt_file, "r");
while ( $line = fgets($f, 1000) ) {
print $line;
}
?>