User downloading files

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Morprok
Forum Newbie
Posts: 1
Joined: Sun Aug 20, 2006 7:45 pm

User downloading files

Post by Morprok »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Ok I'm new to PHP and am trying to make an insanely simple login system where if the password is right, it doesn't matter who you are, you're in. So far I have the html page with a form who's action is pass.php. The form's method is "post". Now in pass.php I'm checking if the password that was inputted via a text field equals "pass" for example.

Code: Select all

<?php
    if($_POST['pass'] == 'pass') {
        //im lost here
    }
    else {
        echo("You entered the wrong password.");
    }
?>
That's what is in pass.php now but I want to make it so that if the password is correct then something like:

Code: Select all

<a href="file.zip">Download the file</a>
happens only using php and without a link or any kind of acknowledgement that you're downloading the file other than the browser's transfer app.

Can someone help me?


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

[color=darkgreen][b]feyd[/b] | "I need hep" doesn't help us help you. Changed to "User downloading files."

[quote="[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1"][b]2.[/b] Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.[/quote]
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

Here is a recent thread that talks about what you want to do:
viewtopic.php?t=53809&highlight=force+download

Also search google for "php force download"
Post Reply