Page 1 of 1

very simple php script help!

Posted: Fri Oct 17, 2008 6:22 am
by mpower
hey guys, im a total noob when it comes to php...

what i need is a simple script that works in the following way:

1. lets assume the name of the script is "get.php"

2. inside the script there are three variables: 1 - path (which corresponds to a folder location on a local drive e.g. "C:\MAIN FOLDER\")
2 - folder (which corresponds to a folder within the main folder on a local drive e.g. "FOLDER\") and
3 - file (which corresponds to a file name within the folder on a local drive "FILE.XXX")

3. then say you type in "get.php?folder=FOLDER&file=FILE" it will link you to the specified file within the folder i.e. "file:\\C:\MAIN FOLDER\FOLDER\FILE.XXX"

is that possible ? thanks in advance!

Re: very simple php script help!

Posted: Fri Oct 17, 2008 7:10 am
by papa
Yeah it's possible!

Re: very simple php script help!

Posted: Fri Oct 17, 2008 7:16 am
by mpower
hehe... can you point me in the right direction as to how i can begin?

Re: very simple php script help!

Posted: Fri Oct 17, 2008 7:18 am
by papa
A lot of usable functions:

http://us2.php.net/manual/en/function.file.php

Look around to get the general idea and then start coding. Be happy to help when you've got some code going :)

I'd start by just reading a file to test and then go from there:
file_get_contents

Re: very simple php script help!

Posted: Fri Oct 17, 2008 5:13 pm
by califdon
Basically, don't expect to learn a programming language by posting an open-ended question in a forum. We can answer specific questions about syntax and design, and review code snippets to suggest where a problem may lie. But there's no practical way to teach you how to program. For that, your best path is to take a class. If you can't manage that, you may be able to learn from a book or an online tutorial, if you already have some programming experience. This forum is for developers to seek advice from other developers. We don't turn away beginners, especially if they have done their homework in advance, but we just can't possibly teach anyone programming.