Jump to content

JamesRyzon

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

JamesRyzon's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you for your quick reply! That was exactily what i was looking for but I didnt know about "IN" in sql, thanks again!
  2. Having some trouble with mysql statements wanting to run multiple types at once this is an example [code] SELECT * FROM cars WHERE Year='$year' AND Model='Ford' OR 'GM' [/code] Just as an exmaple, the query only returns cars from 1990 and Ford type, skipping GM. Any helpful hints on this?
  3. [quote author=Crayon Violent link=topic=96817.msg390824#msg390824 date=1151902605] I have a method for you that will make a link for the user to click, and it calls another script with an id number and the script itself redirects to the file based on the id. It will not show the url in the address bar of the script, however, it will still show the full path to the file in question on the bottom of IE. The only way you can get rid of that is with js but even then, the user can simply disable js and they got it.  The bottom line is that there really is no way to completely hide the source from the user, because the client needs to know where the file is coming from, in order for the xfer to take place.  All you can really do is the methods you've already done: -put locks on the folders the files are in. -require a login system. -requiring paid membership deters a lot of people -use a script like the one below another method also depends on how big your files are. If they are small, you can store the actual file in a database so that they will not actually be in a directory.  The user would click the link and the script would retrieve the data from the database and dynamically create the filename with the extension, dump the data in it, and then delete the file afterwards.  But that's only really going to work efficiently if your files are small. Anyways, here is the code. This code assumes that you have a table in a database that has a list of files and id's associated with them.  The first code is the file that will have the link in it. Let's call it index.php for the hell of it: index.php [code] <a href='getfile.php?id=1'>file 1</a> [/code] yep, that's it.  it can be a plain old html file with a plain old link. I named it .php though cuz chances are you will have a whole lot of files and you probably want to dynamically make a list of links.  okay so the other file is called getfile.php getfile.php [code] <?php $path_to_file = ""; //put the path to the file here //if a link was clicked if ($_GET['id']) {   //you probably might want to sanitize this variable to your tastes   $id = $_GET['id'];   //here is an example query to get the filename by id   $sql = "select filename from table where id='$id'";   $rs = mysql_query($sql);   $filename = mysql_fetch_array($rs);     //if the file actually exists, redirect to the file   if (is_file($path_to_file . $filename['filename'])) {       header("Location:" . $path_to_file . $filename['filename']);   } else { // ..if file not found, give an error message       header("HTTP/1.1 404 Not Found");   } } else { // ..if no id passed, give an error   header("HTTP/1.0 404 Not Found"); } ?> [/code] [/quote] Thank you for the post, and that was what I was doing the entire time really. I appriciate the input and the code you posted looks a lot like what I ended up doing. I agree with you on one thing there is no perfect way to make every browser happy. Ive decided the deographic I am shooting for on my website really would not be concerned with things like Getting a Download that does not log to the system (So i can rank the top 10 downloads). Its a very weird world out there, and there is nothing perfect. I was just hoping someone had a magic fix for IE that I had not heard of before. Thanks for everyones time and I hope something in this thread helps someone else figure out their problem, or come to the realization that they may just have to settle and hope that something improves over time :D
  4. Ugh bumping again. The problem DOSENT Exist in firefox, but i dont want to shut out IE users. I used headers to build the download link and push to it, Firefox is fine since the link dosent show in the URL bar for some reason when they are redirected to a download. Is there a way I can also do this in Internet Explorer? That would be the fix ive been looking for this entire time that would prevent a lot of silly hacking at files (been trying to use htaccess, but for some reason my host wont allow the deny,allow lines ;/) Any help is much, MUCH appriciated on this topic!
  5. [quote author=Acidic.Saliva link=topic=99222.msg390688#msg390688 date=1151870475] lol, I'm kind of a noob, how would I do either of those? EDIT: Oh wait, could I just say like echo "<a href="myphppage.php?username=$username>"? [/quote] You could do that but then in theory if you arent Securing it anyone could just type into their bar http://path.to/yoursite.php?username=whatever To set a session variable youll need to first [code] session_start(); [/code] on the page you want to use sessions on. Then its as simple as [code] $_SESSION['username'] = $someformofusername; [/code] and calling $_SESSION['username'] in your code later
  6. Hoping this is allowed but im bumping the topic for a better explination (Didnt want to create a new thread, incase something in the thread helps someone else help me). I was diving through php.net looking for solutions to my problem. I found out that the main thing i wanted to do was make a button in PHP that will start some downloading and let the download link be controlled by me (So users who press "Download" can not see what directory or  where the file is coming from). I found a few posts on php.net in the headers section (http://www.php.net/header) but none of them were exceptionally helpful in getting me towards a goal of files downloading via a php button, no no one could see. Thanks
  7. [!--quoteo(post=388356:date=Jun 27 2006, 12:31 AM:name=redarrow)--][div class=\'quotetop\']QUOTE(redarrow @ Jun 27 2006, 12:31 AM) [snapback]388356[/snapback][/div][div class=\'quotemain\'][!--quotec--] The easy solution is to add a index.php in that folder. [/quote] Hey, Thanks for the suggestion but that would just take away browsing the files in a "Structure". Thats not really what i was looking for. [!--quoteo(post=388372:date=Jun 27 2006, 01:24 AM:name=phpstuck)--][div class=\'quotetop\']QUOTE(phpstuck @ Jun 27 2006, 01:24 AM) [snapback]388372[/snapback][/div][div class=\'quotemain\'][!--quotec--] Check out this reference.. I think with a little figuring you can htaccess protect the files so they can't be deep linked, shile still allowing logged in users to gain access without multiple log in screeens popping up each time. [a href=\"http://forums.devshed.com/php-development-5/htaccess-and-php-16736.html\" target=\"_blank\"]http://forums.devshed.com/php-development-...-php-16736.html[/a] [/quote] I read that, and I have login and stuff built into my php scripts (Memberlist and whatnot). An example of what im looking for (But not entirely) Might be Rapidshare. The files can be uploaded, but the only way to download the files (In theory?) is through their interface. Thanks.
  8. [!--quoteo(post=387929:date=Jun 26 2006, 02:09 AM:name=BigMike)--][div class=\'quotetop\']QUOTE(BigMike @ Jun 26 2006, 02:09 AM) [snapback]387929[/snapback][/div][div class=\'quotemain\'][!--quotec--] Are you wanting the user to be required to enter in a unique username and password in order to download the files on your site? [/quote] Yes! So far I have registration and everything down, and I can show the links only when they are logged in. What im wanting to prevent, is smarter users finding a way to find the directory the files are in, and just simply accessing them outside of the website, ie: www.somesite.com/somedirectory/somefile.zip while not logged in.
  9. Alright im going to try to explain my problem the best I can. I have a registration system, and points system and stuff using Session Variables. I have things for people to download but i want to require that they must download them by clicking links, not able to just navigate to the files on my webspace and download them. I think it might require some messing with htaccess but im also brand new to this concept. If anyone can help me out I would be very appriciative!
  10. Thank you that worked, is there any reason it was not auto_incrementing the ID on its own? Or is this something about SQL I was unaware of (When adding only one value, it messes up?) Just trying to get some info on this so it dosent happen again. Thanks again!
  11. Recieving the same error pretty much
  12. The entire error i got is this the code im using now $desc = $mons.' defeats '.$name.' in defence'; $sqlstring = "INSERT INTO journal(desc) VALUES('$desc')"; $sql9 = mysql_query($sqlstring)or die(mysql_error() . " in the query $sqlstring");
  13. Tried even copy and pasting it as you have and i still recieve the same error. Ive also tried switching types to compensate and no luck.
  14. Ok ive been at this myself for some time Im having an error inputting to a database, very simple error i assume but i cant seem to fix it (Even when i copy and paste a query from another page which i am POSITIVE works, ive even used phpmyadminl to generate code for me which worked but not inserting my variable) $desc = " ".$mons." defeats ".$name." in defence"; $sql9 = mysql_query("INSERT INTO journal(desc) VALUES('$desc')")or die(mysql_error()); The table has two rows, ID which is set to auto_increment, and desc, which is set to text. i get the following error 10/10 times - after 'near' it shows the data that should be appended to $desc, and sent, but nothing is, sigh, any help?
×
×
  • 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.