Re: [PHP] Logic sought
Write a script that cron runs that checks dates of files and removes 1 month old ones? On Wed, Jul 9, 2008 at 4:45 PM, tedd [EMAIL PROTECTED] wrote: Hi gang: Here's the logic problem. First the site: http://php1.net/b/zip-files/ Now, the site works well enough. The user selects what they want, clicks Submit, the order is assembled in zip file and presented to the user for downloading. However, as it stands now, before the script assembles the test.zip, it deletes (unlinks) the previous test.zip and therein lies the problem. If two, or more, users hit the site at the same time then a RACE condition may have one user getting something they didn't ask for or not getting anything at all. The complicated way I figure I could solve this would be to: 1. Generate a random string name for the file -- instead of test.zip, it could be ax12nhg34.zip. 2. Then when the user selects the download that would trigger a javascript routine that would send the name of the file to be deleted to a slave php script that would unlinks the file. I know this will work, but if the user never downloads the file, then the files accumulate on the server. Does anyone have a better idea? Thanks, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Communicated-Key/Token for SOAP Authentication
Checkout oAuth, to either see how they used it, or for the algo's http://oauth.net Kyle On Sun, Jun 22, 2008 at 7:53 AM, Steve Finkelstein [EMAIL PROTECTED] wrote: Hi all, I'm working on a relatively straight forward Web API that'll have a SOAP presence. The most secure way of going about doing authentication would be undoubtedly client-certificate authentication. I have been able to implement such a service straight forward as there is plenty of documentation out there covering how to do so. I have some clients who're reluctant to manage client certificates at this point in time, and do prefer a communicated-key authentication, very similar to what Amazon and a few of the other big boys do. I'm having a bit of a difficult time coming up with multiple solutions as to how to properly implement this for my service besides stuffing a random hash into my database and making them send it to me over SSL through their message payload. I can then compare the hash against what's in the database + their IP, or something else. Would anyone be able to suggest some algorithm for the way I'm handling the tokens that's more secure and less brute-forcible than the methodology I described above? My objective in this exercise is not to only authenticate who's sending me the SOAP envelope, but also to ensure that whatever token/key system I implement is not open for very simple brute force. If they're able to knock down my brick house, I have other problems --- but I definitely want to build that brick foundation. Suggestions, web articles, books etc., are all welcome! Thank you for any advice from you avid web service gurus. /sf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Case sensitive password
Why not md5 the password, and store the md5 encryption. Then when they type something in, md5 it and compare the md5 strings. That will ensure that it is Case Sensitive On Thu, Jun 19, 2008 at 2:04 PM, R.C. [EMAIL PROTECTED] wrote: Thank you Daniel, I think that did the trick. Am checking this out now... Best R.C. Daniel Brown [EMAIL PROTECTED] wrote in message session_start(); $_SESSION ['userpass'] = $_POST ['pass']; $_SESSION ['authuser'] = 0; $login = VIDEO; $login2 = video; if (($_SESSION['userpass'] == $login) or ($_SESSION['userpass'] == $login2)) { $_SESSION['authuser'] = 1; ? Try this: ?php if(preg_match('/^'.$_SESSION['userpass'].'$/i',$login)) { echo Good.\n; } else { echo Bad.\n; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Bug in SimpleXML?
I was working on a project for XML Parsing. I came across instances where my elements were completely missing. After further Digging into the issue, I found out, that when placing tags inside of an element with text, SimpleXML (and dom Document) ignore the added tags, and the text within. Heres an example. ---ok.xml- ?xml version=1.0 encoding=UTF-8 standalone=yes? Document Article Title pagenum=84 docname=Career Path mar 08Is Your Face on Facebook? /Title SubtitleEmploy simple strategies to market your ?profile? using online social networking./Subtitle BodyTemp Testing Example of SimpleXML Bug.bIs it a bug though?/b/Body FolioTrying to just show Examples/Folio /Article /Document ---ok.xml- ---ok.php- ?php $file = file_get_contents('ok.xml'); $xml = new SimpleXMLElement($file); print_r($xml); print $xml-Article-Body-b . \n; ---ok.php- ---output- SimpleXMLElement Object ( [Article] = SimpleXMLElement Object ( [Title] = Is Your Face on Facebook? [Subtitle] = Employ simple strategies to market your ?profile? using online social networking. [Body] = Temp Testing Example of SimpleXML Bug. [Folio] = Trying to just show Examples ) ) Is it a bug though? ---output- Furthermore if I place b tags at the beginning of of the Body tags ie. BodybTesting/bTemp Testing Example of SimpleXML Bug.bIs it a bug though?/b/Body The text between the /b and b is ignored and is output as follows.. ---output--- SimpleXMLElement Object ( [Article] = SimpleXMLElement Object ( [Title] = Is Your Face on Facebook? [Subtitle] = Employ simple strategies to market your ?profile? using online social networking. [Body] = SimpleXMLElement Object ( [b] = Array ( [0] = Testing [1] = Is it a bug though? ) ) [Folio] = Trying to just show Examples ) ) Testing ---output--- The above output is using ok.php. Is this working as intended?
Re: [PHP] php mysql live feed
Check out jQuery. http://jquery.com On May 20, 2008, at 1:24 PM, [EMAIL PROTECTED] wrote: Okay before i pull more hair out... I am trying to use php to pull mysql data and refresh the mysql data every say 5 seconds for like a live display of the database without the screen reloading. I want the data to refresh but not the screen. Ajax seems to hate me because everything i have seen/read/tried is wrapped around ASP.NET or requires a user interaction to invoke the query. If you have example scripts or a good tutorial that actually works where you can open a php script and the data changes on the page as the database does and the screen does not refresh, and you don’t have to onclick, onfocus, or onblur kind of thing. I would be in your debt Frustrated Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirection
Javascript can help you there. On May 7, 2008, at 4:55 PM, Ben wrote: Is there a way to take all the variables, no matter what their names and values are, from the parameters in a url and POST them to another URL so that they don't show up in the address bar? I've noticed a huge increase in my bounce rate since I added some tracking parameters to my urls, but I need the tracking parameters so I don't trust a client-side redirect. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Forking and fsock
Is there a way I can get my fsock to stay open when the child process exits? Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php