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!
I've even tested it with an "echo", and it shows it's reading the $_COOKIE. This file is backend, and it recieves it's upload from Flash.
EDIT: The upload itself actually works, I just want to be able to identify who uploads what by adding the username to the file name.
Modified a little bit, but so far no luck with this.
In the future, please enclose PHP code in tags, as I have done immediately above. It makes it much easier to read and detect problems.
It's not clear to me what you are trying to do with this code. Why don't you explain what you expect to be in the cookie, what you want the filename to look like, and where you want the file to go? The above code really doesn't make much sense to me. You are using the same variables over and over for no purpose that I can see ($target_path). And you are using misleading variable names. The "target path" should not include the filename, but you are defining a variable named $target_path to be something (the user's name, perhaps?) plus a hyphen plus a filename. Unless I'm missing what you are trying to do, you are confused about what you are putting together in that string. Think it through and write it out on paper.
Sorry about the tags, forgot those. Just as a note, I did not write the majority of this, but I have modified it.
The script is a simple file transfer that I'm using to load files from Flash and send them to the proper directory.
The cookie holds a username, and is used to display it from within Flash. Since the username cookie was already
in the system, I decided to use it again so that I could append it to the filename. The hyphen is ment to separate
the filename and the username added to the file.
I can't help you at all with Flash, but as far as the PHP goes, since you have removed the path from the original file specification (with the $target_path="";), it could be because the function move_uploaded_file() function requires a complete path specification.