Jump to content

PHP download script


_giles_

Recommended Posts

Hi

I'm a PHP newbie working on my first project to build a simple form which emails me the content (this I've done successfully) and then triggers a file download. This is where I’m a bit stuck.

I’ve tried (what seem to me to be) obvious things like trying to trigger hyperlinks etc, I’ve searched all over the place for tutorials, (I can find loads of them for uploading), but I can’t find anything for creating a download script.

I’d really appreciate any tips, or URL’s of appropriate tutorials.
Many thanks in advance

Giles
Link to comment
Share on other sites

Hello,
Could you show a link on the page once the form is submitted like this:?

Place a hidden form element named "goodtogo" with a value of "you bet!" in your form, once submitted:

[code]<?php
if($_POST['goodtogo']) {
echo "<a href=\"where/file/is.zip\">Download Now!</a>";
}
?>[/code]

Not sure if this helps, but I hope it inspires great things.  :)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.