Re: [PHP] Error Querying Database
It seems like there are several questions emerging, but ... Try echoing your query to the page by putting echo $query in your code before you call mysql, then copy it and run it in phpmyadmin. If it runs then you know your problem is somewhere else like the connection. This can really help you find typos that can cause mysterious results. If you want to use the same page to process the form (my preference) then put a hidden field in your form like: and wrap the form processing code like so: if (isset($_POST['phpaction'])) { //process submitted form data } else { //processing for initial form entry } When the form is initially loaded it will ignore the first part There are a 1000 ways to do this, but this is pretty straightforward. On Dec 15, 2010, at 1:34 PM, Gary wrote: > > "Steve Staples" wrote in message > news:1292440837.5460.8.ca...@webdev01... >> On Wed, 2010-12-15 at 13:42 -0500, Gary wrote: >>> I cant seem to get this to connect. This is to my local testing server, >>> which is on, so we need not worry that I have posted the UN/PW. >>> >>> This is a duplicate of a script I have used countless times and it >>> worked. >>> The error message is 'Error querying database.' >>> >>> Some one point out the error of my ways? >>> >>> Gary >>> >>> >>> " method="post"> >>> >>> >>> Name of Beer >>> >>> >>> >>> >>> Maker of Beer >>> >>> >>> >>> >>> Type of Beer >>> >>> Imported >>> Domestic >>> Craft >>> Light >>> >>> >>> >>> >>> >>> Sold in >>> Singles>> /> >>> Six Packs >>> Cans >>> Bottles >>> Draft >>> >>> >>> Size >>> >>> >>> Description>> rows="5"> >>> >>> >>> >>> >>> >>> >>> >>> >> $beername = $_POST['beername']; >>> $manu = $_POST['manu']; >>> $type = $_POST['type']; >>> $singles = $_POST['singles']; >>> $six = $_POST['six']; >>> $can = $_POST['can']; >>> $bottles = $_POST['bottles']; >>> $tap = $_POST['tap']; >>> $size = $_POST['size']; >>> $desc = $_POST['desc']; >>> $ip= $_SERVER['REMOTE_ADDR']; >>> >>> $dbc = mysqli_connect('localhost','root','','rr')or die('Error connecting >>> with MySQL Database'); >>> >>> $query = "INSERT INTO beer (beername, manu, type, singles, six, can, >>> bottles, tap, size, desc, ip )"." VALUES ('$beername', '$manu', '$type', >>> '$singles', '$six', '$can', '$bottles', '$tap', '$size', '$desc', >>> '$ip' )"; >>> >>> $result = mysqli_query($dbc, $query) >>> or die('Error querying database.'); >>> >>> >>> mysqli_close($dbc); >>> >>> >>> >>> -- >>> Gary >> >> >> Read Ash's reply... but basically, you're running the query with POST >> variables, and inserting them on page display as well as on form submit. >> >> can you ensure that you can connect from the command line? >> >> >> if you may take some criticism, you should rethink your database design, >> as well as the page flow/design... you should either post the form to a >> new page, or if it is back to itself, you should check to see that you >> have in fact posted it before just blindly inserting into the database >> (as currently, every time you view the page, you will insert into the >> database, even if completely empty values). >> > > Steve > > Thank you for your reply. > > I did not see a reply from Ashley, but I would love to read it. > > I always welcome criticism, however this form is for the owner of a bar > where he will inputing his list of beer that he sells. The rest of the code > that is not there is I will have the list then echo to screen below the > form. This is an internal list only, no customers will be seeing itif > that makes any difference to your suggestion. > > On your one point > > <<(as currently, every time you view the page, you will insert into the > database, even if completely empty values).>> > > Is this always the case when you process a form onto itself? Or is there a > fix? > > I did just create a new page, inserted the script onto it, and got the same > error message. > > Again, thank you for your help. > > Gary > > > > __ Information from ESET Smart Security, version of virus signature > database 5706 (20101215) __ > > The message was checked by ESET Smart Security. > > http://www.eset.com > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
Re: [PHP] APC - Upload progress problem. apc
On Sep 17, 2009, at 2:09 PM, Andrea Giammarchi wrote: I wonder if massive uploads, like the ones you're coding for, really aren't that common. I can imagine hard-coding that 3600 myself, and thinking, "no way someone's going to be uploading a single file for longer than an hour, or even close to it." me too, also because for a silly connection problem you could even re-start the upload from the scratch. I do not think HTTP and a POST form "as is" is suitable for these kind of tasks, I would rather think about a truly simple Desktop software, Python for portability or AutoIT if it is only for windows, able to split the file in chunks 2 Mb each and open a conversation with the server in order to be able to resume the upload if something goes wrong or if the user would like to. With a desktop application you can send credentials and the SHA1 of the file in order to create it's ghost image on the server. Every chunk will be saved a part and when finished appended via file pointers to the main one. To allow a resume you simply need to communicate the current big file size / 2 Mb and you know which chunk needs to be uploaded. It is more simple to do than to explain, if you got this basic example about how to proceed, but you need privileges over the file in order to create a SHA1 and read only chunks via pointer, rather than send everything in a shot. Regards Woo hoo! Got php-apc patched and am testing now. Good points about long downloads, but right now folks are using FTP and they don't like it or understand it. In a biz environment, connections are pretty stable, and usually fairly fast. This gives them a familiar interface to upload. Anyway, this was the spec I was given. Adding interruption recovery is a nice phase 2, upgrade. I am just happy it is working now. The APC upload progress thing works great (above mentioned limitations aside). Long haul, but pretty slick in the end. Thanks again for all y'alls help. Phred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how i assign a js variable to a php variable
On Sep 17, 2009, at 2:43 PM, Andrea Giammarchi wrote: I have to disagree Ash, you can pass js variable values to PHP but only through a page load. Then you could use $_REQUEST, $_POST, $_GET to retrieve it. I have done this before. And I am sure Ash does it on daily basis, the problem is the used therm: I want to *assign* ... not pass, assign! I am quite sure that is what he meant, since I cannot count people reading in the middle of the page thinking it can interact directly with nodes and javascript, and being "a new one", I think Ash replied in the correct way. Regards All true, and probably appropriate to clarify the relationship between php and js. However, if the goal is to pre-set something in php land so you don't have to pass it with your next page navigation, you could use ajax to to pass the value to a simple php script that in turn updates a php session variable, so that it is already set when you do your next real page load. You would still be "calling a page" technically, but your current displayed page would remain in place and php would have the value available on its next page load. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
On Sep 17, 2009, at 12:27 AM, Ben Dunlap wrote: upload keys, and any keys created via apc_add(). This listing includes a Timeout value, which is "none" for the apc_add keys and 3600 for the upload keys. Somewhat suspicious, I'd say, since the keys stop being working after 1 hour of use. APC lets you set a number of timeout values: apc.gc_ttl, apc.user_ttl, apc.ttl. I have set all of these to be gianormous, but the upload key timeout value never changes. I can't believe that this is an inherent limitation, or nobody would be using this. The Google claims people are using this for big uploads, so I I've just had my first glance at the APC source code, so I could be misreading something, but it appears that 3600 was hardcoded in until about 3 weeks ago. Here's the trunk commit that seems to have made that value configurable: http://svn.php.net/viewvc?view=revision&revision=287534 And there's a reference to a PECL bug in the commit message: http://pecl.php.net/bugs/bug.php?id=16717 I have no idea when this change will trickle through to a production build -- or if it already has, but I suspect not, because the hardcoded 3600 was still present in the latest available source code tarball at http://pecl.php.net/get/APC Ben Ben: Thank you so much, I felt like I was on crazy pills! I was afraid it was a bug. I have generally just used whatever is at whatever host, until this project, and didn't really think something so glaring could be in there. WTF! So, it seems like it would be pretty straight forward to fix this, if I was willing to run on a custom version until this fix is released. Do people do that? What do you think? The alternative is starting over with python or perl. Sheesh! Phred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
He's back... Well folks.. The good news is that APC and my upload progress is working! : ) The bad news is, ...kind of working. : | It does exactly what I want, but at 1 hour of progress-barring, it stops. I.e., APC stops returning a response for the given key. Whether the connection has allowed 100MB, 500MB or 1GB. The file actually continues to upload, for hours if necessary, and eventually gets there. APC provides a sort of management page that lets you look at the APC status, including a listing of "User Cache Entries" which includes any still-valid upload keys, and any keys created via apc_add(). This listing includes a Timeout value, which is "none" for the apc_add keys and 3600 for the upload keys. Somewhat suspicious, I'd say, since the keys stop being working after 1 hour of use. APC lets you set a number of timeout values: apc.gc_ttl, apc.user_ttl, apc.ttl. I have set all of these to be gianormous, but the upload key timeout value never changes. I can't believe that this is an inherent limitation, or nobody would be using this. The Google claims people are using this for big uploads, so I should be able to. I have looked through Apache/unix to see if this limit refers to something set deeper in the system, but everything that I know of that I can loosen up, I have. Any ideas? Thanks, Phred On Sep 15, 2009, at 8:51 AM, Nathan Nobbe wrote: On Tue, Sep 15, 2009 at 12:05 AM, Phred White wrote: Folks: Thanks for all your help and suggestions. Miracle of miracles I am now getting a response,so I can start some level of debugging. I am not sure exactly what has been going on. I NEVER got a response, then I did - when I tried uploading some different files. It seems that larger files always give a negative response for me. Now I am thinking that it has been a timing issue. My ajax stuff doesn't repeat yet, so there is currently only one request. It seems that if the file is a little too large, the first response is always false, that may be the case for very small files too. I finally just picked a file that was the right size. Since I could never verify that APC was responding, it didn't occur to me to go ahead and iron out the ajax stuff. Anyway now I can move forward. Thanks all for all your suggestions, sorry this ends up being such a stupid conclusion. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
Folks: Thanks for all your help and suggestions. Miracle of miracles I am now getting a response,so I can start some level of debugging. I am not sure exactly what has been going on. I NEVER got a response, then I did - when I tried uploading some different files. It seems that larger files always give a negative response for me. Now I am thinking that it has been a timing issue. My ajax stuff doesn't repeat yet, so there is currently only one request. It seems that if the file is a little too large, the first response is always false, that may be the case for very small files too. I finally just picked a file that was the right size. Since I could never verify that APC was responding, it didn't occur to me to go ahead and iron out the ajax stuff. Anyway now I can move forward. Thanks all for all your suggestions, sorry this ends up being such a stupid conclusion. Your, phred On Sep 14, 2009, at 8:33 PM, Nathan Nobbe wrote: On Mon, Sep 14, 2009 at 4:50 PM, Phred White wrote: Andrea: I have in my php.ini: apc.rfc1867 = On apc.rfc1867_freq = 10K The apc.php diagnostic/report page says it is on. It just returns false. I will look at your zip file and see if something jumps out. what about your other apc.rfc1867 settings? are you posting the correct field to the server to tell apc to start tracking, and also are you grabbing the correct value when trying to determine the status in your progress tracking script? by default, your form needs an input like, then in the progress checking script you will need something like, the names of these variables depend upon apc.rfc1867_name and apc.rfc1867_prefix respectively. take a look at this article, it was really helpful, http://www.ibm.com/developerworks/opensource/library/os-php-v525/ also, to get going fast, dont bother w/ the progress script yet. just focus on getting apc to start tracking the progress. you can use the stock apc.php script from the distro and upload a large file; this will give you time to check in apc.php. -nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
Andrea: I have in my php.ini: apc.rfc1867 = On apc.rfc1867_freq = 10K The apc.php diagnostic/report page says it is on. It just returns false. I will look at your zip file and see if something jumps out. Thanks, Phred On Sep 14, 2009, at 4:04 PM, Andrea Giammarchi wrote: Can you write here how you configured APC? In my old test I had to set apc.rfc1867 = On and if you grab the zip: http://www.3site.eu/examples/APCQuery.zip tell me what is exactly wrong (I tried ages ago though, I am using other strategies right now:http://code.google.com/p/noswfupload/ - not suitable for 1Gb of files though) About trying to grab info via PHP ... there is a little problem, that page will be executed only after the file has been sent, so obviously you'll never be able to know size, error, tmp_name, before the file has benn fully stored in the tmp or specific folder, got the problem? Regards > CC: f...@thefsb.org; php-general@lists.php.net > From: phpl...@planetphred.com > To: an_...@hotmail.com > Subject: Re: [PHP] APC - Upload progress problem. apc > Date: Mon, 14 Sep 2009 15:21:40 -0500 > > Andrea: > > I see. That is a cool idea, but you are right, concurrency could > definitely be a problem. That's what APC is supposed to solve because > it tags the file with a unique ID. But I can't get that sucker to > return the value to me! If I could get APC to work I would be done. > > I also started looking at trying to grab the temp file, ". > $_FILES['video_file']['tmp_name'], and then keep checking its size on > the server, but I don't think I can get the temp name from php until > it is uploaded. Do you know if that is possible? > > One other thing, I looked at a canned media management web app ($875 > US) that will do this uploading, and it doesn't require APC, so there > definitely is some way to do this with basic PHP. > > Thanks, Phred > > > > On Sep 14, 2009, at 1:55 PM, Andrea Giammarchi wrote: > > > > > The concept of my last link is this: > > the instant before you do the upload you ask PHP to scan the tmp > > folder, or the folder used to upload files (often the tmp) and you > > snap number of files, then the upload starts, and it will create a > > temp file with a PHP predefined prefix, you array_diff the snap with > > the current file list and you get the file that the user is uploading. > > > > At that point if you are lucky the input="file" field will give you > > access to its fileSize, and you have everything to create a progress > > bar: the polled incremental tmp file size in the server, plus the > > total in the client, a bit of transitions/effects and that's it. > > > > This method is not ideal, generally speaking, because it could > > easily suffer concurrency between multiple users. > > > > I did not know Flash player had to put the entire file in memory, it > > sounds truly silly for scalability reasons, are you absolutely sure > > about this? > > > > About APC you need to enable it and so far I had no problems with > > files up to 350 Mb , I wonder why 1Gb should be a problem. > > > > Regards > > > >> CC: php-general@lists.php.net > >> From: phpl...@planetphred.com > >> To: f...@thefsb.org > >> Date: Mon, 14 Sep 2009 13:16:13 -0500 > >> Subject: Re: [PHP] APC - Upload progress problem. apc > >> > >> > >> On Sep 14, 2009, at 9:15 AM, Tom Worster wrote: > >> > >>> > >>> with files that big, perhaps could write client js that polls a > >>> script on > >>> the server that simply returns the file size(s)? if you want a > >>> thermometer, > >>> use the number to resize a colored div. > >>> > >>> > >> Thanks Tom, for weighing in. > >> > >> Having js poll a script on the server is kind of what APC was about, > >> and perl as well. Are you saying I could use PHP on the server side > >> to > >> do this? It seems almost obvious, but no one mentions it any where on > >> the web, so a expected there was some fundamental limitation without > >> APC. > >> > >> Do you have any idea what this script might look like? Is it possible > >> to get the temp file name before the upload is completed so that its > >> size can be monitored? > >> > >> If it is, it is just too dang simple! ...but I'd take it for sure. > >> > >> Thanks, Phred > >> > >> > >> -- > >> PHP General Mailing List (http://www.php.net/) > >> To unsubscribe, visit: http://www.php.net/unsub.php > >> > > > > _ > > More than messages–check out the rest of the Windows Live™. > > http://www.microsoft.com/windows/windowslive/ > check out the rest of the Windows Live™. More than mail–Windows Live™ goes way beyond your inbox. More than messages
Re: [PHP] APC - Upload progress problem. apc
On Sep 14, 2009, at 3:30 PM, Nathan Nobbe wrote: On Mon, Sep 14, 2009 at 2:21 PM, Phred White wrote: Andrea: I see. That is a cool idea, but you are right, concurrency could definitely be a problem. That's what APC is supposed to solve because it tags the file with a unique ID. But I can't get that sucker to return the value to me! If I could get APC to work I would be done. I also started looking at trying to grab the temp file, ". $_FILES['video_file']['tmp_name'], and then keep checking its size on the server, but I don't think I can get the temp name from php until it is uploaded. Do you know if that is possible? One other thing, I looked at a canned media management web app ($875 US) that will do this uploading, and it doesn't require APC, so there definitely is some way to do this with basic PHP. Pread, just hopping in the thread again, so excuse me if this has been covered, but have you gone over you environment settings thoroughly? one of the key values for the upload feature to work is, apc.rfc1867 which needs to be set to 1 or On. also, the php version needs to be at least >= 5.2. not sure on the concurrency issues, but thats something that could easily be verified w/ a test once youve got it running. -nathan thanks for jumpin in Nathan. The water's fine! (Except for the sharks : ) I have in my php.ini: apc.rfc1867 = On apc.rfc1867_freq = 10K The latter is because i read somewhere that some OS configs don't like the default of 0. APC has a file, apc.php, that sows all the stats for apc, and it says file upload is on and it is caching files quite nicely, though I don't care too much about that right now. my set-up: php-apc 3.0.19, Apache2, php 5.2.10, no suhosin patch, no FastCGI - the latter two items i have heard cause problems with APC also, so they are not part of my config. Phred
Re: [PHP] APC - Upload progress problem. apc
Andrea: I see. That is a cool idea, but you are right, concurrency could definitely be a problem. That's what APC is supposed to solve because it tags the file with a unique ID. But I can't get that sucker to return the value to me! If I could get APC to work I would be done. I also started looking at trying to grab the temp file, ". $_FILES['video_file']['tmp_name'], and then keep checking its size on the server, but I don't think I can get the temp name from php until it is uploaded. Do you know if that is possible? One other thing, I looked at a canned media management web app ($875 US) that will do this uploading, and it doesn't require APC, so there definitely is some way to do this with basic PHP. Thanks, Phred On Sep 14, 2009, at 1:55 PM, Andrea Giammarchi wrote: The concept of my last link is this: the instant before you do the upload you ask PHP to scan the tmp folder, or the folder used to upload files (often the tmp) and you snap number of files, then the upload starts, and it will create a temp file with a PHP predefined prefix, you array_diff the snap with the current file list and you get the file that the user is uploading. At that point if you are lucky the input="file" field will give you access to its fileSize, and you have everything to create a progress bar: the polled incremental tmp file size in the server, plus the total in the client, a bit of transitions/effects and that's it. This method is not ideal, generally speaking, because it could easily suffer concurrency between multiple users. I did not know Flash player had to put the entire file in memory, it sounds truly silly for scalability reasons, are you absolutely sure about this? About APC you need to enable it and so far I had no problems with files up to 350 Mb , I wonder why 1Gb should be a problem. Regards CC: php-general@lists.php.net From: phpl...@planetphred.com To: f...@thefsb.org Date: Mon, 14 Sep 2009 13:16:13 -0500 Subject: Re: [PHP] APC - Upload progress problem. apc On Sep 14, 2009, at 9:15 AM, Tom Worster wrote: with files that big, perhaps could write client js that polls a script on the server that simply returns the file size(s)? if you want a thermometer, use the number to resize a colored div. Thanks Tom, for weighing in. Having js poll a script on the server is kind of what APC was about, and perl as well. Are you saying I could use PHP on the server side to do this? It seems almost obvious, but no one mentions it any where on the web, so a expected there was some fundamental limitation without APC. Do you have any idea what this script might look like? Is it possible to get the temp file name before the upload is completed so that its size can be monitored? If it is, it is just too dang simple! ...but I'd take it for sure. Thanks, Phred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ More than messages–check out the rest of the Windows Live™. http://www.microsoft.com/windows/windowslive/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
On Sep 14, 2009, at 9:15 AM, Tom Worster wrote: with files that big, perhaps could write client js that polls a script on the server that simply returns the file size(s)? if you want a thermometer, use the number to resize a colored div. Thanks Tom, for weighing in. Having js poll a script on the server is kind of what APC was about, and perl as well. Are you saying I could use PHP on the server side to do this? It seems almost obvious, but no one mentions it any where on the web, so a expected there was some fundamental limitation without APC. Do you have any idea what this script might look like? Is it possible to get the temp file name before the upload is completed so that its size can be monitored? If it is, it is just too dang simple! ...but I'd take it for sure. Thanks, Phred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
Hey Andrea: Ahhh yes, I've come full circle. I STARTED with php-apc. I really wanted an all-PHP solution, but apc_fetch() ALWAYS returns false a value for uploads. I can apc_add() something and apc_fetch it... but not for uploads : ( The apc.php summary page they supply that sows all the caching stats, shows upload is enabled, but no other info about upload. It seems like the upload is never being communicated to APC. (my set-up: php-apc 3.0.19, Apache2, php 5.2.10, no suhosin patch, no FastCGI) If I can get APC to do its basic thing, then I have the rest figured out (though I am going to look at your solution in more detail, thx). Unfortunately, I just don't know how to debug APC. No errors are generated - the problem is totally opaque to me. I looked at your link, and it looks great, perhaps you have some insight into my narrow APC problem. One other thing, Eddie was talking about APC not being thread-safe. I have heard this before, but also heard it refuted. Do you have any insight on this? I am going insane, so any help you can toss my way would be most merciful. Thanks, Phred On Sep 14, 2009, at 8:45 AM, Andrea Giammarchi wrote: I am not sure why you ended up with Flash, but here there is a good old example with APC: http://webreflection.blogspot.com/2007/10/upload-progress-bar-with-php5-apc-and.html Regards CC: php-general@lists.php.net From: phpl...@planetphred.com To: oorza...@gmail.com Date: Mon, 14 Sep 2009 04:39:26 -0500 Subject: Re: [PHP] APC - Upload progress problem. apc Bummer... It looked so promising, but on Macs, Flash has to load the entire file into memory to upload! R. So, it isn't viable for big files (Gig +) if you need it to be cross platform. So now I am looking at perl of all things! If you have any ideas let me know. thanks for all your help so far. Phred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Share your memories online with anyone you want. http://www.microsoft.com/middleeast/windows/windowslive/products/photos-share.aspx?tab=1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
On Sep 13, 2009, at 8:50 PM, Eddie Drapkin wrote: On Sun, Sep 13, 2009 at 9:38 PM, Phred White wrote: On Sep 13, 2009, at 7:34 PM, Eddie Drapkin wrote: On Sun, Sep 13, 2009 at 8:29 PM, Phred White > wrote: On Sep 11, 2009, at 1:17 PM, Eddie Drapkin wrote: On Fri, Sep 11, 2009 at 1:02 PM, Phred White > wrote: Hey folks.. Anybody ever use APC to show upload progress? It sounds really cool, but apc_fetch always returns false a value for uploads. I can apc_add something and fetch it, but not for uploads : ( (set-up: php-apc 3.0.19, Apache2, php 5.2.10, no suhosin patch) There is little info to google on this, and I've been through it. I was hoping some hard core, tireless, php programmer just knew the answer. With high anxiety, Phred I recently had to do roughly the same thing (visual upload progress) and I had done some research into APC. What I learned was that the upload tracking didn't work with FastCGI (which would have prevented our switch to nginx, but not a deal breaker) and what broke the deal, though, was the fact that APC's upload progress is apparently not thread safe, so if person A is uploading a file and person B starts an upload, you get a silent failure. Which brings me to another point, it seems to silently fail. Ultimately, I went with a flash based solution because the APC solution had way too many problems to be really useful. It's a nice thought, but I wouldn't recommend it. I know this isn't exactly what you wanted, but I had a similar experience and thought I would share :) Dang! You are exactly right - that isn't what I wanted to hear! : ( But better to know now, then when my timeline is already used up. Did you write your own flash based solution, or use an canned one? Thanks, Phred I actually wound up using swfupload because of a friend's recommendation and also because there's a nifty jQuery plugin for it. The project's main site: http://swfupload.org The jQuery plugin I'm using: http://blogs.bigfish.tv/adam/2009/06/14/swfupload-jquery-plugin/ The *only* issue I could find with a flash based uploader (I don't regard flash installation as an issue because we're a video based site and well, if you're using our site to watch videos...) was there's an as-of-yet unresolved bug in linux flash clients that locks a browser until upload is completed. Adobe's bug tracker seems to be down for me at the moment, but if you really want the bug, let me know offlist and I'll supply it later. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hey Eddie: One more question... I have an existing form that provides other data that need to be linked to the file upload. It looks like swfupload, just uploads all by its lonesome. I also need the javascript form validator to be triggered before any uploading occurs. Is this possible? You don't have to tell me how (though I wouldn't mind a few clues). I just want to know if it will meet my needs once i dig in. Thanks That should all be possible. I'd take a look at http://demo.swfupload.org/v220/featuresdemo/index.php as that has most of that happening on the page and you can bootleg some of their example code :) Bummer... It looked so promising, but on Macs, Flash has to load the entire file into memory to upload! R. So, it isn't viable for big files (Gig +) if you need it to be cross platform. So now I am looking at perl of all things! If you have any ideas let me know. thanks for all your help so far. Phred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
On Sep 13, 2009, at 7:34 PM, Eddie Drapkin wrote: On Sun, Sep 13, 2009 at 8:29 PM, Phred White wrote: On Sep 11, 2009, at 1:17 PM, Eddie Drapkin wrote: On Fri, Sep 11, 2009 at 1:02 PM, Phred White > wrote: Hey folks.. Anybody ever use APC to show upload progress? It sounds really cool, but apc_fetch always returns false a value for uploads. I can apc_add something and fetch it, but not for uploads : ( (set-up: php-apc 3.0.19, Apache2, php 5.2.10, no suhosin patch) There is little info to google on this, and I've been through it. I was hoping some hard core, tireless, php programmer just knew the answer. With high anxiety, Phred I recently had to do roughly the same thing (visual upload progress) and I had done some research into APC. What I learned was that the upload tracking didn't work with FastCGI (which would have prevented our switch to nginx, but not a deal breaker) and what broke the deal, though, was the fact that APC's upload progress is apparently not thread safe, so if person A is uploading a file and person B starts an upload, you get a silent failure. Which brings me to another point, it seems to silently fail. Ultimately, I went with a flash based solution because the APC solution had way too many problems to be really useful. It's a nice thought, but I wouldn't recommend it. I know this isn't exactly what you wanted, but I had a similar experience and thought I would share :) Dang! You are exactly right - that isn't what I wanted to hear! : ( But better to know now, then when my timeline is already used up. Did you write your own flash based solution, or use an canned one? Thanks, Phred I actually wound up using swfupload because of a friend's recommendation and also because there's a nifty jQuery plugin for it. The project's main site: http://swfupload.org The jQuery plugin I'm using: http://blogs.bigfish.tv/adam/2009/06/14/swfupload-jquery-plugin/ The *only* issue I could find with a flash based uploader (I don't regard flash installation as an issue because we're a video based site and well, if you're using our site to watch videos...) was there's an as-of-yet unresolved bug in linux flash clients that locks a browser until upload is completed. Adobe's bug tracker seems to be down for me at the moment, but if you really want the bug, let me know offlist and I'll supply it later. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hey Eddie: One more question... I have an existing form that provides other data that need to be linked to the file upload. It looks like swfupload, just uploads all by its lonesome. I also need the javascript form validator to be triggered before any uploading occurs. Is this possible? You don't have to tell me how (though I wouldn't mind a few clues). I just want to know if it will meet my needs once i dig in. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
On Sep 13, 2009, at 7:34 PM, Eddie Drapkin wrote: On Sun, Sep 13, 2009 at 8:29 PM, Phred White wrote: On Sep 11, 2009, at 1:17 PM, Eddie Drapkin wrote: On Fri, Sep 11, 2009 at 1:02 PM, Phred White > wrote: Hey folks.. Anybody ever use APC to show upload progress? It sounds really cool, but apc_fetch always returns false a value for uploads. I can apc_add something and fetch it, but not for uploads : ( (set-up: php-apc 3.0.19, Apache2, php 5.2.10, no suhosin patch) There is little info to google on this, and I've been through it. I was hoping some hard core, tireless, php programmer just knew the answer. With high anxiety, Phred I recently had to do roughly the same thing (visual upload progress) and I had done some research into APC. What I learned was that the upload tracking didn't work with FastCGI (which would have prevented our switch to nginx, but not a deal breaker) and what broke the deal, though, was the fact that APC's upload progress is apparently not thread safe, so if person A is uploading a file and person B starts an upload, you get a silent failure. Which brings me to another point, it seems to silently fail. Ultimately, I went with a flash based solution because the APC solution had way too many problems to be really useful. It's a nice thought, but I wouldn't recommend it. I know this isn't exactly what you wanted, but I had a similar experience and thought I would share :) Dang! You are exactly right - that isn't what I wanted to hear! : ( But better to know now, then when my timeline is already used up. Did you write your own flash based solution, or use an canned one? Thanks, Phred I actually wound up using swfupload because of a friend's recommendation and also because there's a nifty jQuery plugin for it. The project's main site: http://swfupload.org The jQuery plugin I'm using: http://blogs.bigfish.tv/adam/2009/06/14/swfupload-jquery-plugin/ The *only* issue I could find with a flash based uploader (I don't regard flash installation as an issue because we're a video based site and well, if you're using our site to watch videos...) was there's an as-of-yet unresolved bug in linux flash clients that locks a browser until upload is completed. Adobe's bug tracker seems to be down for me at the moment, but if you really want the bug, let me know offlist and I'll supply it later. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Thanks Eddie. I will look into it. I agree, if you don't have Flash use your telegraph or something. Sheesh! (iPhone users excepted - they morn their lack of Flash) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
On Sep 11, 2009, at 4:01 PM, tedd wrote: At 2:17 PM -0400 9/11/09, Eddie Drapkin wrote: On Fri, Sep 11, 2009 at 1:02 PM, Phred White wrote: Hey folks.. > Anybody ever use APC to show upload progress? Nope, I choose not to complicate my life. :-) Instead, I give the user one of these: http://webbytedd.com/bb/wait/ Besides, what does the user have to know anyway that makes it so important that they see a progress bar? Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com those are SWEET! That page is going to become one of my favorite pages just to look at for therapeutic purposes : ) Unfortunately, my folks will be uploading a gig at a crack, so the really need to know what is actually going on! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
On Sep 11, 2009, at 1:17 PM, Eddie Drapkin wrote: On Fri, Sep 11, 2009 at 1:02 PM, Phred White wrote: Hey folks.. Anybody ever use APC to show upload progress? It sounds really cool, but apc_fetch always returns false a value for uploads. I can apc_add something and fetch it, but not for uploads : ( (set-up: php-apc 3.0.19, Apache2, php 5.2.10, no suhosin patch) There is little info to google on this, and I've been through it. I was hoping some hard core, tireless, php programmer just knew the answer. With high anxiety, Phred I recently had to do roughly the same thing (visual upload progress) and I had done some research into APC. What I learned was that the upload tracking didn't work with FastCGI (which would have prevented our switch to nginx, but not a deal breaker) and what broke the deal, though, was the fact that APC's upload progress is apparently not thread safe, so if person A is uploading a file and person B starts an upload, you get a silent failure. Which brings me to another point, it seems to silently fail. Ultimately, I went with a flash based solution because the APC solution had way too many problems to be really useful. It's a nice thought, but I wouldn't recommend it. I know this isn't exactly what you wanted, but I had a similar experience and thought I would share :) Dang! You are exactly right - that isn't what I wanted to hear! : ( But better to know now, then when my timeline is already used up. Did you write your own flash based solution, or use an canned one? Thanks, Phred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] APC - Upload progress problem. apc
Hey folks.. Anybody ever use APC to show upload progress? It sounds really cool, but apc_fetch always returns false a value for uploads. I can apc_add something and fetch it, but not for uploads : ( (set-up: php-apc 3.0.19, Apache2, php 5.2.10, no suhosin patch) There is little info to google on this, and I've been through it. I was hoping some hard core, tireless, php programmer just knew the answer. With high anxiety, Phred