For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > November 2005 > Question from PHP newbie









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Question from PHP newbie
Johny

2005-11-27, 6:56 pm

Hi all

I have never done any work with php but I need to understand how something
works and see if it will help me in a problem I have.

The site I am creating has a number of links throughout it to download a
file (the same file every time).
The file will need to be changed every so often but I don't want to have to
change the links on every page and I also don't want to have another page
that's in between the download links and the file itself.

I've come across a site that is doing a similar thing to what I want to do
and the way its been done is they have created a page/file called
download.php and this is what the download links point to.
When it is clicked from any download link the download begins and if you
click cancel you are still at the page where the link was clicked.

I assume that the page/file download.php could be edited and the link to the
download be changed which is what I'm looking for.

Can anybody shed any light on how I can do this, perhaps I'm barking up the
wrong tree and I don't actually need a php file.

Thanks in advance
J


Geoff Berrow

2005-11-27, 6:56 pm

Message-ID: <dmcoap$3rl$1@newsg3.svr.pol.co.uk> from Johny contained the
following:

>
>Can anybody shed any light on how I can do this, perhaps I'm barking up the
>wrong tree and I don't actually need a php file.


Well you could simply rename the file to be downloaded to match your
link. But if you want to have a download.php file then it can contain
something as simple as this:

<?php
header("Location: http:www.example.com/myfiletodownload.zip")
?>

The just change the contents of the file when the download file changes.

--
Geoff Berrow 0110001001101100010000000110
0011011010110110010001101111011001110010
11
1001100011011011110010111001110101011010
11
Johny

2005-11-27, 6:56 pm

Thanks a lot works a treat


"Geoff Berrow" <blthecat@ckdog.co.uk> wrote in message
news:ilpjo1dk303dbdnkn59tq5ts5orihbspfg@
4ax.com...
> Message-ID: <dmcoap$3rl$1@newsg3.svr.pol.co.uk> from Johny contained the
> following:
>
the[color=darkred]
>
> Well you could simply rename the file to be downloaded to match your
> link. But if you want to have a download.php file then it can contain
> something as simple as this:
>
> <?php
> header("Location: http:www.example.com/myfiletodownload.zip")
> ?>
>
> The just change the contents of the file when the download file changes.
>
> --
> Geoff Berrow 0110001001101100010000000110
> 0011011010110110010001101111011001110010
11
> 1001100011011011110010111001110101011010
11



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com