Computer Webmaster Gaming Console Graphics Forum

Welcome to the Computer Webmaster Gaming Console Graphics Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > PHP
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help.

Google
Reply
 
LinkBack Thread Tools Display Modes
Old 07-01-2007, 3:38 PM   #1
Jay Vance
 
Jay Vance's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Looking for a way to generate an HTML file download page...

....that will automatically create a download link for every file (and
folder, if possible) in a particular directory. The contents of the
directory will be changing frequently and I don't want to have to manually
update the download page. Is such a thing possible? Thanks!

Jay


 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Advertisements
Old 07-01-2007, 3:38 PM   #2
spearman
 
spearman's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Looking for a way to generate an HTML file download page...

<?php

if ($handle = opendir('.'))

{

while ($file=readdir($handle))

{

if ($file != "." && $file != "..")

{

echo "<a href='$file'>$file</a><br>\n";

}

}

closedir($handle);

}

else

{

echo "Error Processing this stuff!";

}

?>

"Jay Vance" <jay@mtboard.com> wrote in message
news:bf1pl3$a14f4$1@ID-190190.news.uni-berlin.de...
> ...that will automatically create a download link for every file (and
> folder, if possible) in a particular directory. The contents of the
> directory will be changing frequently and I don't want to have to manually
> update the download page. Is such a thing possible? Thanks!
>
> Jay
>
>



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 3:38 PM   #3
Jay Vance
 
Jay Vance's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Looking for a way to generate an HTML file download page...

I'm really, really new at this, so please forgive my ignorance. Where do I
put this code? Thanks again!

Jay

"spearman" <net@news.com> wrote in message
news:J3_Qa.59866$sY2.28252@rwcrnsc51.ops.asp.att.n et...
> <?php
>
> if ($handle = opendir('.'))
>
> {
>
> while ($file=readdir($handle))
>
> {
>
> if ($file != "." && $file != "..")
>
> {
>
> echo "<a href='$file'>$file</a><br>\n";
>
> }
>
> }
>
> closedir($handle);
>
> }
>
> else
>
> {
>
> echo "Error Processing this stuff!";
>
> }
>
> ?>
>
> "Jay Vance" <jay@mtboard.com> wrote in message
> news:bf1pl3$a14f4$1@ID-190190.news.uni-berlin.de...
> > ...that will automatically create a download link for every file (and
> > folder, if possible) in a particular directory. The contents of the
> > directory will be changing frequently and I don't want to have to

manually
> > update the download page. Is such a thing possible? Thanks!
> >
> > Jay
> >
> >

>
>



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 3:38 PM   #4
Matt Montgomery
 
Matt Montgomery's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Looking for a way to generate an HTML file download page...

You put it at the location in the page you want the links to be displayed.

"Jay Vance" <jay@mtboard.com> wrote in message
news:bf1qtq$a4bv7$1@ID-190190.news.uni-berlin.de...
> I'm really, really new at this, so please forgive my ignorance. Where do

I
> put this code? Thanks again!
>
> Jay
>
> "spearman" <net@news.com> wrote in message
> news:J3_Qa.59866$sY2.28252@rwcrnsc51.ops.asp.att.n et...
> > <?php
> >
> > if ($handle = opendir('.'))
> >
> > {
> >
> > while ($file=readdir($handle))
> >
> > {
> >
> > if ($file != "." && $file != "..")
> >
> > {
> >
> > echo "<a href='$file'>$file</a><br>\n";
> >
> > }
> >
> > }
> >
> > closedir($handle);
> >
> > }
> >
> > else
> >
> > {
> >
> > echo "Error Processing this stuff!";
> >
> > }
> >
> > ?>
> >
> > "Jay Vance" <jay@mtboard.com> wrote in message
> > news:bf1pl3$a14f4$1@ID-190190.news.uni-berlin.de...
> > > ...that will automatically create a download link for every file (and
> > > folder, if possible) in a particular directory. The contents of the
> > > directory will be changing frequently and I don't want to have to

> manually
> > > update the download page. Is such a thing possible? Thanks!
> > >
> > > Jay
> > >
> > >

> >
> >

>
>



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 3:38 PM   #5
Jay Vance
 
Jay Vance's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Looking for a way to generate an HTML file download page...

Thanks!

Jay

"Matt Montgomery" <NOSPAMmatt@NOSPAMchums.com> wrote in message
news:9Q_Qa.98$s01.106097@news.uswest.net...
> You put it at the location in the page you want the links to be displayed.
>
> "Jay Vance" <jay@mtboard.com> wrote in message
> news:bf1qtq$a4bv7$1@ID-190190.news.uni-berlin.de...
> > I'm really, really new at this, so please forgive my ignorance. Where

do
> I
> > put this code? Thanks again!
> >
> > Jay
> >
> > "spearman" <net@news.com> wrote in message
> > news:J3_Qa.59866$sY2.28252@rwcrnsc51.ops.asp.att.n et...
> > > <?php
> > >
> > > if ($handle = opendir('.'))
> > >
> > > {
> > >
> > > while ($file=readdir($handle))
> > >
> > > {
> > >
> > > if ($file != "." && $file != "..")
> > >
> > > {
> > >
> > > echo "<a href='$file'>$file</a><br>\n";
> > >
> > > }
> > >
> > > }
> > >
> > > closedir($handle);
> > >
> > > }
> > >
> > > else
> > >
> > > {
> > >
> > > echo "Error Processing this stuff!";
> > >
> > > }
> > >
> > > ?>
> > >
> > > "Jay Vance" <jay@mtboard.com> wrote in message
> > > news:bf1pl3$a14f4$1@ID-190190.news.uni-berlin.de...
> > > > ...that will automatically create a download link for every file

(and
> > > > folder, if possible) in a particular directory. The contents of the
> > > > directory will be changing frequently and I don't want to have to

> > manually
> > > > update the download page. Is such a thing possible? Thanks!
> > > >
> > > > Jay
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 3:38 PM   #6
Jay Vance
 
Jay Vance's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Looking for a way to generate an HTML file download page...

OK, I have a little PHP script that I think will do what I need it to do,
but I want to run the script with some HTML "window dressing". I seem to
recall reading down below that I can't call PHP from within HTML, so I guess
I need to call HTML from within the PHP script. How do I do that? I'm
trying to do it with "include" but can't seem to get the syntax right, not
sure where to use the "include" statement to call the HTML file.

Here's what I have:

<?php

if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != ".." && $file != "index.php")
{
echo "<a href=$file>$file</a>\n <br>";
}
}
closedir($handle);
}
?>

I want to call an HTML file called "download.html". Where do I put it?

Jay

"Jay Vance" <jay@mtboard.com> wrote in message
news:bf1pl3$a14f4$1@ID-190190.news.uni-berlin.de...
> ...that will automatically create a download link for every file (and
> folder, if possible) in a particular directory. The contents of the
> directory will be changing frequently and I don't want to have to manually
> update the download page. Is such a thing possible? Thanks!
>
> Jay
>
>



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 07-01-2007, 3:40 PM   #7
slapkicksy
 
slapkicksy's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Looking for a way to generate an HTML file download page...


"Jay Vance" <jay@mtboard.com> wrote in message
news:bf21qf$a2c0f$1@ID-190190.news.uni-berlin.de...
> OK, I see what it does, lists all the files in the directory with a
> hyperlink. The only problem is that when I click on a link the browser
> actually opens the file instead of downloading it. As you can see, I'm
> really ignorant about this. What do I need to do to have the link

download
> the file instead of opening it?


Zip them up. Then all files will download.


> Jay
>
>
>
> "Bad Man" <heyho@letsgo.com> wrote in message
> news:Xns93B9B7D8BECBFsonicyouth@206.127.4.10...
> > On 15 Jul 2003, "Jay Vance" <jay@mtboard.com> impressively belched the
> > following:
> >
> > if you just paste that code into a page on its own you will see what it
> > does. note that the '.' in the opendir() statement means that it is
> > reading files from the current directory. you could always use opendir
> > ('images/') or any other directory name.
> >
> >
> >
> > > I'm really, really new at this, so please forgive my ignorance. Where
> > > do I put this code? Thanks again!
> > >
> > > Jay
> > >
> > > "spearman" <net@news.com> wrote in message
> > > news:J3_Qa.59866$sY2.28252@rwcrnsc51.ops.asp.att.n et...
> > >> <?php
> > >>
> > >> if ($handle = opendir('.'))
> > >>
> > >> {
> > >>
> > >> while ($file=readdir($handle))
> > >>
> > >> {
> > >>
> > >> if ($file != "." && $file != "..")
> > >>
> > >> {
> > >>
> > >> echo "<a href='$file'>$file</a><br>\n";
> > >>
> > >> }
> > >>
> > >> }
> > >>
> > >> closedir($handle);
> > >>
> > >> }
> > >>
> > >> else
> > >>
> > >> {
> > >>
> > >> echo "Error Processing this stuff!";
> > >>
> > >> }
> > >>
> > >> ?>

> >

>
>



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Featured Websites
Free Space
Free Space
Free Space Free Space
Reply
Tags: , , , ,




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I pass data to an HTML page so that it can edit it? Tom Thackrey PHP 1 07-01-2007 3:37 PM
How to pass data to HTML page without cookies? Robert Oschler PHP 1 07-01-2007 3:37 PM
Where does PHP embedded in an HTML page execute? rush PHP 0 07-01-2007 3:37 PM
embedded php in html file, how to tell calling html file? MeNotHome PHP 1 07-01-2007 3:17 PM
page with no .html olwen HTML 6 07-01-2007 1:57 PM


Featured Websites




All times are GMT +1. The time now is 2:36 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98