Re: [PHP] Unexpected Notice message
On Thu, Jul 5, 2012 at 6:54 PM, RGraph.net support wrote: > Hi, > >> that the code should be fixed. > > Or the error reporting turned down... :-) And one day, you decide to write define('QUERY_STRING', "Oh I was so stupid that day"); and since you turned down your error reporting, you will have lots of fun! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unexpected Notice message
Hi, > that the code should be fixed. Or the error reporting turned down... :-) -- Richard, RGraph.net support JavaScript charts for your website using RGraph http://www.rgraph.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to make a secure download ?
On 05/07/12 14:32, donkfat...@donkfather.eu wrote: Hi, I am trying to put a file to download. I want it secure so only the people having the password can access it. I made a page that requires a password.. if the password is correct it changes the password send it on my mail and redirects the user to another script. This script searches in the database for the id given with GET and finds the name of the file which is md5(something). it changes the name of the file in md5(smth else). After that it searches in the download folder for a file named md5(smth else). if it finds the file it gives you the link to the file. So i need to find a way to change the filename after the user downloads the file. to keep it secure so the user wont be able to share the link to oters. if you need more info ask :D thanks and sorry for my bad english . Sounds like you are overcomplicating it. Following what you've already done though... Have the original files stored somewhere outside of the web root. That way they aren't accessible whatsoever + you shouldn't have to change any of the files at any stage. Then you can simply update/change the ID that associates with it in your database when that URL is hit... Gibbs -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to make a secure download ?
Hi, I am trying to put a file to download. I want it secure so only the people having the password can access it. I made a page that requires a password.. if the password is correct it changes the password send it on my mail and redirects the user to another script. This script searches in the database for the id given with GET and finds the name of the file which is md5(something). it changes the name of the file in md5(smth else). After that it searches in the download folder for a file named md5(smth else). if it finds the file it gives you the link to the file. So i need to find a way to change the filename after the user downloads the file. to keep it secure so the user wont be able to share the link to oters. if you need more info ask :D thanks and sorry for my bad english . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unexpected Notice message
On Thu, Jul 5, 2012 at 3:10 AM, Arno Kuhl wrote: > -Original Message- > From: Tim Streater [mailto:t...@clothears.org.uk] > Sent: 04 July 2012 06:56 PM > To: Marc Guay; php-general@lists.php.net > Subject: Re: [PHP] Unexpected Notice message > > On 04 Jul 2012 at 16:51, Marc Guay wrote: > >>> Notice: Use of undefined constant QUERY_STRING - assumed 'QUERY_STRING' in >> >> I would guess that it's asking you to add quotes around QUERY_STRING...? > > As in: > if (strlen($_SERVER['QUERY_STRING']) > 0) { > > > Cheers -- Tim > > > Excellent, a bit surprised but that was it, thanks a lot. > > Cheers > Arno Why does this surprise you? $_SERVER is an array with string indices, one of which happens to be the string 'QUERY_STRING'. However, your code is trying to reference a constant named QUERY_STRING that does not exist. The code will work because PHP will assume you meant to use a string instead of a constant, but this will also generate a notice to let you know that the code should be fixed. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Unexpected Notice message
-Original Message- From: Tim Streater [mailto:t...@clothears.org.uk] Sent: 04 July 2012 06:56 PM To: Marc Guay; php-general@lists.php.net Subject: Re: [PHP] Unexpected Notice message On 04 Jul 2012 at 16:51, Marc Guay wrote: >> Notice: Use of undefined constant QUERY_STRING - assumed 'QUERY_STRING' in > > I would guess that it's asking you to add quotes around QUERY_STRING...? As in: if (strlen($_SERVER['QUERY_STRING']) > 0) { Cheers -- Tim Excellent, a bit surprised but that was it, thanks a lot. Cheers Arno -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php