ivands Posted May 6, 2009 Share Posted May 6, 2009 So im sending the date.seconds data to php. end i want to validate the time. But when the data gets to the php script. its already seconds to late. So my question is: Is there any way of knowing how long it took for the data to get to the php? Quote Link to comment https://forums.phpfreaks.com/topic/157148-send-date-data-from-flash-to-php/ Share on other sites More sharing options...
premiso Posted May 6, 2009 Share Posted May 6, 2009 Why not give it a 5 second lead way and see if that works. So on the flash side, add 5 seconds. Then on the php side check that the time is within 5 seconds of the current time. As far as knowing how long it takes, you simply echo out the time php has minus the time that was received by flash. But I doubt this will be 100% consistent each time, so a 2-5 second lead way may solve that. Quote Link to comment https://forums.phpfreaks.com/topic/157148-send-date-data-from-flash-to-php/#findComment-828048 Share on other sites More sharing options...
ivands Posted May 6, 2009 Author Share Posted May 6, 2009 ye I already tried that. but its a validation process. So I need it to be precise. Quote Link to comment https://forums.phpfreaks.com/topic/157148-send-date-data-from-flash-to-php/#findComment-828058 Share on other sites More sharing options...
premiso Posted May 6, 2009 Share Posted May 6, 2009 ye I already tried that. but its a validation process. So I need it to be precise. I understand that, but unfortunately flash applications depend on the machine how (quickly) they run. On a brand new machine the time will be different than on an older machine. Since it really depends on the client and the cache size etc. Then there is the time it takes to send the flash data on the server end to PHP, which can also be variable depending on the server load. (At least it would make sense on that). How to solve your issue, I have no clue. As there can be so many variables with the flash end. I mean even PHP scripts run randomly depend on the server load. I can refresh a page of mine that just echo's out "Test" and one time it could take .00004 seconds and the next it takes .00003 seconds. Granted we are talking about micro seconds, but the same will apply. If the time varies each time the script is ran, perhaps you can grab the highest amount of seconds on average it takes to run and the lowest. Use that for validation basis. I do not think, with Flash and PHP, you could get much more accurate. But I am no Flash expert. That just makes logical sense to me. Quote Link to comment https://forums.phpfreaks.com/topic/157148-send-date-data-from-flash-to-php/#findComment-828063 Share on other sites More sharing options...
ivands Posted May 6, 2009 Author Share Posted May 6, 2009 well I was just thinking maybe there is a why in PHP to know how long it took for itself to be loaded. Probably not. But you might know a good why of securing a xml file on my server. You see, i want to load in a xml file with flash. but it must only be accessible buy flash. So that's why i used php to send me the xml file if the date is valid. Quote Link to comment https://forums.phpfreaks.com/topic/157148-send-date-data-from-flash-to-php/#findComment-828072 Share on other sites More sharing options...
premiso Posted May 6, 2009 Share Posted May 6, 2009 But you might know a good why of securing a xml file on my server. Put it outside of the document root and call it from there. So if your server path is: /home/user/www/index.php (where index.php is visible) Put the xml files in /home/user/xml/xmlfiles.xml Then just include the files that way. I am not sure if flash can do that, but it should not have a problem with it. Quote Link to comment https://forums.phpfreaks.com/topic/157148-send-date-data-from-flash-to-php/#findComment-828074 Share on other sites More sharing options...
ivands Posted May 6, 2009 Author Share Posted May 6, 2009 Sadly that's not working either :'( :'( :'( i think its a security error Quote Link to comment https://forums.phpfreaks.com/topic/157148-send-date-data-from-flash-to-php/#findComment-828086 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.