passing php undefined variable through html link

Is this the correct syntax?
echo’Download here’;
can you please help?

Almost
[php]echo ‘Download Here’;[/php]

There is another way of doing this, but I personally like doing this way for it gives you the option of using urlencode if you wanted to. Check php.net for info:

You don’t need the <?php for you are already in php (or you should be ;)) then in you download php page you would do something like:
[php]$file = $_POST[‘download_file’]; [/php]

make sure you escape $_POST for users can manipulate the argument.

Would it not be $file = $_GET[‘download_file’];

When i click on the link it displays a blank page with the above item in the address bar!but the download does not start.Can you help me throgh this?

/download.php?download_file=uploads/Artwork.pdf

Thanks a lot for your support Strider64 and lothop it was very helpful!
The problem is solved!thabks guys

Sponsor our Newsletter | Privacy Policy | Terms of Service