Re: [PHP] PHP / Procmail / MIME decoder, Imagemagick, MySQL, PDF fax management system
>> Surely someone has done this, but I can't find itand I'm too busy and >> cowardly to write it myself :-) Then get your wallet out. If you want email handling (ie Mime parsing), then the mimeDecode class in PEAR will do this, and put the resulting data (attachments and all) in an array structure for you to play with. > If that sounds strange, I'm the kind of person who gets annoyed at > people who put screenshots in MSWord documents! Ahh MSWord. Unfortunately I'm stuck with OpenOffice for the time being, [looks longingly in the direction of MSOffice] -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated November 1st) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP - Web/list Question...
At 4:08 PM -0800 11/9/08, bruce wrote: hi tedd... no offense... but how does this get me to where i was talking about going??? this is simply a demo of breaking a list up across multiple pages... thanks No offense taken. I read: I have a list that extends over multiple pages. there might be 200 items, and i don't want to have the items listed on the same page as it would be too long. i can break the list up, so i can have it be displayed over multiple pages. And I thought that you were asking for a way to do that. However, now seeing what you actually asked, I would use a database to record each item the user picked and then when displaying the pages again, would check the dB first to see if the item should be noted as checked or not. I would tie it all together with a session. If your user wants to check-out, then you have a record of all the items he selected during his visit and can show them on a single page. This of course would require the user to post/get each page UNLESS you use ajax and write to the dB via a slave php script. That's not all that difficult to do. In any event, those are the two ways I would consider. Cheers, tedd -Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: Sunday, November 09, 2008 4:02 PM To: bruce; php-general@lists.php.net Subject: Re: [PHP] PHP - Web/list Question... At 8:26 PM -0800 11/8/08, bruce wrote: Hi. I've got a question/issue that I want to bounce off the list. >I have a list that extends over multiple pages. there might be 200 items, and i don't want to have the items listed on the same page as it would be too long. i can break the list up, so i can have it be displayed over >multiple pages. however, i want the user to select different items from the list. given that the selected items might be over different pages, what's the best way of keeping a running track of the items that have been selected?? I could have each page be a form, and do a post/get where i then keep track of the selected items from page to page, but that would appear to get ugly. i'm looking for pointers to other sites/code that might have already implemented this kind of scenario. thoughts/pointers would be appreciated... Without reading any one else's reply, here's something you might consider. http://webbytedd.com/bbb/paging/index.php?page=1 Cheers, 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 -- --- 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] Managed VPS recommendations
Larry Garfield schreef: ... I believe "that guy" Dan Brown might have something up your alley, although he might fall over on the 'douchebag' requirement ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP / Procmail / MIME decoder, Imagemagick, MySQL, PDF fax management system
> fair Fair ?! It does an outstanding job! :-) -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated November 1st) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP / Procmail / MIME decoder, Imagemagick, MySQL, PDF fax management system
On Sun, 2008-11-09 at 21:50 -0700, Dan Harrington wrote: > Hello, > > I have seen procmail and PERL, and some MIME handling scripts...but I > haven't seen PHP, Procmail, Mysql, and MIME handling to effectively handle > incoming emails. I don't know PERL, so naturally I'd like to see it all > written in stuff that I can understand and tweak if needbe. > > I have a Fax to Email service that sends me emails with all my faxes. I > want to process and parse them as follows: > Fax >> multi-page PDFs >> My Email >> Procmail >> PHP / MIME decoder / > Imagemagick >> MySQL >> save PDF >> Imagemagick each page to preview > thumbnails. > > The attachments would be stored (or links to attachments stored on file > system) along with main message stored in MySQL, and Imagemagick would make > thumbnails of each page of the multi-page PDFs. > > I could then have my office assistant browse the messages by web browser, > add keywords, To/From, Subject, categories to each of the > messages,images,PDFs for later perusal and searching. And when I wanted to > go back a year ago and try to retrieve an old fax, it wouldn't be so hard. > :-) > > Surely someone has done this, but I can't find itand I'm too busy and > cowardly to write it myself :-) > > Thanks > Dan > > This may sound a bit of a strange question, but why put the fax in a PDF? I mean, it's a bitmap graphic, so why not just leave it in a bitmap format? If that sounds strange, I'm the kind of person who gets annoyed at people who put screenshots in MSWord documents! Ash www.ashleysheridan.co.uk
Re: [PHP] PHP - Web/list Question...
At 4:08 PM -0800 11/9/08, bruce wrote: hi tedd... no offense... but how does this get me to where i was talking about going??? this is simply a demo of breaking a list up across multiple pages... thanks No offense taken. I read: I have a list that extends over multiple pages. there might be 200 items, and i don't want to have the items listed on the same page as it would be too long. i can break the list up, so i can have it be displayed over multiple pages. And I thought that you were asking for a way to do that. However, now seeing what you actually asked, I would use a database to record each item the user picked and then when displaying the pages again, would check the dB first to see if the item should be noted as checked or not. I would tie it all together with a session. If your user wants to check-out, then you have a record of all the items he selected during his visit and can show them on a single page. This of course would require the user to post/get each page UNLESS you use ajax and write to the dB via a slave php script. That's not all that difficult to do. In any event, those are the two ways I would consider. Cheers, tedd -Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: Sunday, November 09, 2008 4:02 PM To: bruce; php-general@lists.php.net Subject: Re: [PHP] PHP - Web/list Question... At 8:26 PM -0800 11/8/08, bruce wrote: Hi. I've got a question/issue that I want to bounce off the list. >I have a list that extends over multiple pages. there might be 200 items, and i don't want to have the items listed on the same page as it would be too long. i can break the list up, so i can have it be displayed over >multiple pages. however, i want the user to select different items from the list. given that the selected items might be over different pages, what's the best way of keeping a running track of the items that have been selected?? I could have each page be a form, and do a post/get where i then keep track of the selected items from page to page, but that would appear to get ugly. i'm looking for pointers to other sites/code that might have already implemented this kind of scenario. thoughts/pointers would be appreciated... Without reading any one else's reply, here's something you might consider. http://webbytedd.com/bbb/paging/index.php?page=1 Cheers, 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 I want to suggest a solution that might get your life easier. Why don't you group those items and make then put each group in a page. Your user will choose the first group will post the data (say using a submit button labeled "Next >>") and then you can get him to the next group. You can keep the data in a db table and then when your user finishes choosing the items you can give him the option to change any of the categories you have. In that time you can allow him to edit and go back to the final step. If of course it is possible to group the items and make a logical division. -- Thodoris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] object persistence within a session
> I've found that I don't mind a few well organized database calls per > page for the information I need. Opening up a database connection is very expensive. Sending one more simple / fast query is dirt cheap. Time it on your system with http://php.net/microtime and see. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] object persistence within a session
On Mon, Nov 10, 2008 at 8:55 AM, <[EMAIL PROTECTED]> wrote: > >> I've found that I don't mind a few well organized database calls per >> page for the information I need. > > Opening up a database connection is very expensive. > > Sending one more simple / fast query is dirt cheap. > > Time it on your system with http://php.net/microtime and see. > > Perhaps, but the examples I usually find when cleaning up code are of the variety where a script executes one statement to find a list of parent records, iterates through those records and inside the loop it executes another statement (sometimes multiple statements!) to get the details, update records, etc. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] object persistence within a session
On Mon, Nov 10, 2008 at 8:55 AM, <[EMAIL PROTECTED]> wrote: > >> I've found that I don't mind a few well organized database calls per >> page for the information I need. > > Opening up a database connection is very expensive. > > Sending one more simple / fast query is dirt cheap. > > Time it on your system with http://php.net/microtime and see. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Or xdebug [1]. [1] http://xdebug.org/docs/profiler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP / Procmail / MIME decoder, Imagemagick, MySQL, PDF fax management system
Ashley Sheridan wrote: This may sound a bit of a strange question, but why put the fax in a PDF? I mean, it's a bitmap graphic, so why not just leave it in a bitmap format? Most fax systems I've seen deal with TIFF images but they can be in a slightly weird format (missing lines, requiring stretching or something like that). Putting the data into PDF is trivial (this is done automatically by hylafax system IIRC). Also it seems Dan's issue is not converting it in PDF format, as he gets the data sent to him in PDF already. For the email decoding, as Richard said, the PEAR MimeDecode classes do a fair job of this. Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] It's Sunday, and I'm bored...
Govinda wrote: > > On Nov 9, 2008, at 12:28 PM, Richard Heyes wrote: >> >> Subversion, or svn for short. Helps you maintain code bases. Far >> better than regular backups (though by no means a replacement). > > I looked it over briefly and it looks smart for serious collaborated > efforts.. but i ask - is anyone finding it makes sense for one-man shows? > (For the time to get up to speed with this maybe I could just pay more > attention to making/naming my own backups?) >> >> >>> It's nice to have at least loose communities like this list so we solo >>> freelancers don't think we're simply mad. >> >> You are... :-) > Well yes, but I meant without company.. See when we are in a herd, then > even if we're all mad, then somehow it seems alright. ;-) We even have > professional looking tools to track which version of madness! > Absolutely - I use it for my (largely) solo projects. For one thing, not all projects remain solo efforts - at least two of my recent projects have been big enough to bring someone else in, and at that point if the stuff is all in SVN then it's MUCH easier... Also, I find that I can easily be a different "person" on another day, and want to experiment with some refactoring or neat way of doing stuff. SVN gives me a simple way to fall back to the previous stuff without too many headaches. AND (this is probably most relevant to the original thread) when I commit code to the repository, it asks for a comment to attach to the commit. That's really useful (as I think Richard finds) when I come to do my timesheets, which is usually less often than my commits... Cheers Pete -- Peter Ford phone: 01580 89 Developer fax: 01580 893399 Justcroft International Ltd., Staplehurst, Kent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP - Web/list Question...
You could paginate the list, in a simple form, but include at the top the values already selected on other/previous pages. You also might consider letting the user type a few letters of what they want, and show them the matching results to be added. This presumes most users have a familiarity with the possible selections. Another option might be to put in a collapsing tree-like structure a la GUI file-systems like Mac OS. So all the values would be on the page, but they'd show/hide the hierarchical groupings of interest. But this only makes sense if the data can be intuitively laid out as a hierarchy. And it presumes Javascript-enabled viewers, which may or may not fit long-term plans involving cell phones and/or disabled users and/or whatever. [The preceding sentence is an attempt to head off the endless JS thread that often seems to follow a JS solution] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] object persistence within a session
> Perhaps, but the examples I usually find when cleaning up code are of > the variety where a script executes one statement to find a list of > parent records, iterates through those records and inside the loop it > executes another statement (sometimes multiple statements!) to get the > details, update records, etc. That's usually bad... But that doesn't mean that ONE more DB query will kill you. And there are times when the JOINs for the one-query solution will kill you anyway, but with proper pagination, the dozen multi-query solution will zip along merrily. What is "good" for the DB storage and what users end up wanting collated on a page are occasionally at odds, especially for the admin pages. If you've tweaked the front-facing user side and correctly laid-out the DB for maximum scalability for the users, the admin side can sometimes be a bit hairy like that... Which is fine, since the admin side is much less trafficked. Short Version: Sometimes you should break the rules. Knowing when is called "experience" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] object persistence within a session
> -Original Message- > From: Andrew Ballard [mailto:[EMAIL PROTECTED] > Sent: Monday, November 10, 2008 8:04 AM > To: [EMAIL PROTECTED] > Cc: php-general@lists.php.net > Subject: Re: [PHP] object persistence within a session > > On Mon, Nov 10, 2008 at 8:55 AM, <[EMAIL PROTECTED]> wrote: > > > >> I've found that I don't mind a few well organized database calls per > >> page for the information I need. > > > > Opening up a database connection is very expensive. > > > > Sending one more simple / fast query is dirt cheap. > > > > Time it on your system with http://php.net/microtime and see. > > > > > > Perhaps, but the examples I usually find when cleaning up code are of > the variety where a script executes one statement to find a list of > parent records, iterates through those records and inside the loop it > executes another statement (sometimes multiple statements!) to get the > details, update records, etc. From strictly a coder's standpoint, I'm sure this helps view and understand source in an efficient manner. However, I think that you should always try to condense stuff like that into a JOIN query. Logically, it makes tons more sense to me to do that in SQL rather than PHP, since that's the sort of thing SQL was constructed to do in the first place (the "R" in RDBMS). I find often that web programmers try to accomplish recursive database manipulation with multiple calls/connections to the database server in PHP rather than taking the time to structure a proper SQL query that will do the job and return all of the necessary data in one fell swoop. Just my 2c. As always, if scale is not a concern, then you have quite a bit more breathing room to work with your chosen methods. I just analogize it with people doing complex DOM traversals and such when they could use 2 lines of standard CSS to get the job done... Todd Boyd Web Programmer
Re: [PHP] object persistence within a session
On Mon, 2008-11-10 at 14:29 +, [EMAIL PROTECTED] wrote: > And there are times when the JOINs for the one-query solution will > kill you anyway, but with proper pagination, the dozen multi-query > solution will zip along merrily. But joins are what relation databases excel at, so PHP would be the bottleneck in your example. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] object persistence within a session
> But joins are what relation databases excel at, so PHP would be the > bottleneck in your example. Not always... If your JOIN can not be easily constrained in the query, until some kind of processing of the result set takes place, you can end up with a monster interim result set that will swap the DB server, and send it to its knees. For example, if you need a result set of 10 items, some of which (but not all) relate to a second table, and the left outer join the generates millions of rows... Also: SQL is great at many things. But something like a tree traversal or other results that depend on the rows returned can be a real bear, especially for pages that are not your core scalable must-have part of the site -- Where you don't want to complicate everything else for just this one admin/report page. I'm only saying that, on occasion, the dozen DB calls wins out over a JOIN that swaps madly. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] object persistence within a session
On Mon, 2008-11-10 at 14:47 +, [EMAIL PROTECTED] wrote: > > But joins are what relation databases excel at, so PHP would be the > > > bottleneck in your example. > > > > Not always... > > > > If your JOIN can not be easily constrained in the query, until some kind of > processing of the result set takes place, you can end up with a monster > interim result set that will swap the DB server, and send it to its knees. > > > > For example, if you need a result set of 10 items, some of which (but not > all) relate to a second table, and the left outer join the generates millions > of rows... > > > > Also: > > > > SQL is great at many things. > > > > But something like a tree traversal or other results that depend on the rows > returned can be a real bear, especially for pages that are not your core > scalable must-have part of the site -- Where you don't want to complicate > everything else for just this one admin/report page. > > > > I'm only saying that, on occasion, the dozen DB calls wins out over a JOIN > that swaps madly. > > > Then surely it is still a badly created query? If you're using PHP to filter the results, even if it's in order to create a second query, your SQL is not as good as it could be. The only thing that would benefit is where a query needs information that is only available from outside the database, which in turn is based on information from a query. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Managed VPS recommendations
On Mon, 2008-11-10 at 14:26 +0100, Jochem Maas wrote: > Larry Garfield schreef: > > ... > > I believe "that guy" Dan Brown might have something up your alley, > although he might fall over on the 'douchebag' requirement ;-) >From Larry's Post: "We're looking for a company we can partner with long-term for hosing several dozen sites." Don't do it Dan, he wants to hose several of your sites. On a more related note :) You may have trouble with VPS system, most expect you to do your own configuration... that's half the point of a VPS, you get root access. Of course, since your specs all sound about the same, you could probably whip up a script that does the update management for you. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP - Web/list Question...
hi T!! This might work! The items in my "list" are really scripts for given colleges, that have been created by developers. This phase is a part of the workflow for the script so the app can test the script, or run it in the production phase. The testing portion involves testing the script, looking at the results, and then either promoting the successful script to the production folder, or returning the script back to the dev folder. so, the testing portion is where i want to "group" the scripts. in reality, i should look to test files either: -individual script (just want to run a quick test for a college) -by a user (might have made a few mistakes, so i want to test all his/her scripts) -based on the date of completed dev (test all the scripts in the last 24hrs that are in dev) -any other possible groups??? this process could work, as i could then simply have some checkboxes that would interface with the mysql select to generate the list... i could then allow the user to "delete" if nessasary from the list.. on the production side, since i'm going to crawl all the colleges to update the data, i'd simply create/update a group that has all the colleges, which can be automated, with no need for manual interaction... this could work, and would eliminate the need for the pagination/session approach.. if you have any other thoughts regarding possible selects/issues for the testing/grouping process let me know your thoughts!! thanks guys.. -Original Message- From: Thodoris [mailto:[EMAIL PROTECTED] Sent: Monday, November 10, 2008 5:53 AM To: tedd Cc: php-general@lists.php.net Subject: Re: [PHP] PHP - Web/list Question... > At 4:08 PM -0800 11/9/08, bruce wrote: >> hi tedd... >> >> no offense... but how does this get me to where i was talking about >> going??? >> this is simply a demo of breaking a list up across multiple pages... >> >> thanks >> > > > No offense taken. > > I read: > >> I have a list that extends over multiple pages. there might be 200 >> items, >> and i don't want to have the items listed on the same page as it >> would be >> too long. i can break the list up, so i can have it be displayed over >> multiple pages. > > And I thought that you were asking for a way to do that. > > However, now seeing what you actually asked, I would use a database to > record each item the user picked and then when displaying the pages > again, would check the dB first to see if the item should be noted as > checked or not. I would tie it all together with a session. > > If your user wants to check-out, then you have a record of all the > items he selected during his visit and can show them on a single page. > > This of course would require the user to post/get each page UNLESS you > use ajax and write to the dB via a slave php script. That's not all > that difficult to do. > > In any event, those are the two ways I would consider. > > Cheers, > > tedd > > >> >> -Original Message- >> From: tedd [mailto:[EMAIL PROTECTED] >> Sent: Sunday, November 09, 2008 4:02 PM >> To: bruce; php-general@lists.php.net >> Subject: Re: [PHP] PHP - Web/list Question... >> >> >> At 8:26 PM -0800 11/8/08, bruce wrote: >>> Hi. >>> >>> I've got a question/issue that I want to bounce off the list. >>> >> >I have a list that extends over multiple pages. there might be 200 >> items, >>> and i don't want to have the items listed on the same page as it >>> would be >>> too long. i can break the list up, so i can have it be displayed over >> >multiple pages. however, i want the user to select different items >> from the >>> list. given that the selected items might be over different pages, >>> what's >>> the best way of keeping a running track of the items that have been >>> selected?? >>> >>> I could have each page be a form, and do a post/get where i then >>> keep track >>> of the selected items from page to page, but that would appear to >>> get ugly. >>> i'm looking for pointers to other sites/code that might have already >>> implemented this kind of scenario. >>> >>> thoughts/pointers would be appreciated... >> >> Without reading any one else's reply, here's something you might >> consider. >> >> http://webbytedd.com/bbb/paging/index.php?page=1 >> >> Cheers, >> >> 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 > > I want to suggest a solution that might get your life easier. Why don't you group those items and make then put each group in a page. Your user will choose the first group will post the data (say using a submit button labeled "Next >>") and then you can get him to the next group. You can keep the data in a db table and then when your user finishes choosing the items you can give him the option to change any of the categories you have. In that time you can allow him to edit and go back to the final step. If of course it is p
Re: [PHP] Managed VPS recommendations
On Mon, 10 Nov 2008 09:54:21 -0500, Robert Cummings <[EMAIL PROTECTED]> wrote: > On Mon, 2008-11-10 at 14:26 +0100, Jochem Maas wrote: >> Larry Garfield schreef: >> >> ... >> >> I believe "that guy" Dan Brown might have something up your alley, >> although he might fall over on the 'douchebag' requirement ;-) > >>From Larry's Post: > > "We're looking for a company we can partner with long-term for hosing > several dozen sites." > > Don't do it Dan, he wants to hose several of your sites. Curses, you found me out! > On a more related note :) You may have trouble with VPS system, most > expect you to do your own configuration... that's half the point of a > VPS, you get root access. Of course, since your specs all sound about > the same, you could probably whip up a script that does the update > management for you. > > Cheers, > Rob. Could we? Yes. Do we want to? Absolutely not. :-) For my company, we are very clear with our clients that we do not do server management. If something goes wrong with the server or network routing or anything of the sort, don't talk to us. Talk to the host. For my personal site, it's for an online RPG club where I don't have the time to be a full time sysadmin myself and frankly there's no one else in the club I'd trust anywhere near a root password on any box, let alone the one that runs our whole club. So that's a couple of votes for individual people. What company do they work for? :-) We're not looking for "a guy", we're looking for a firm with a good reputation. --Larry Garfield -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Managed VPS recommendations
On Mon, Nov 10, 2008 at 11:09 AM, Larry Garfield <[EMAIL PROTECTED]> wrote: > > So that's a couple of votes for individual people. What company do they work > for? :-) We're not looking for "a guy", we're looking for a firm with a good > reputation. Parasane is a whole company, not just me. I'm just the one who started it back in 2000 but I wouldn't set you up on a VPS anyway. I began to refuse to sell those in the last few months because they're more of a scam than anything. "Hey, let's charge the client the same amount as a fully-dedicated server - if not more - but put them on a shared box with limited resources." Yes, the host makes more money --- a LOT more money --- on the sale of VPS systems, especially when you stack them up in copious amounts like people do. I can charge one customer what I pay for the whole server, another customer what the license fees are for the software, and the remaining eighteen are profit but the problem is that *I* know they're getting crap service. There are a few decent providers who do VPS stuff though. Surprisingly (and much to my chagrin) is that GoDaddy is one of them. -- http://www.parasane.net/ [EMAIL PROTECTED] || [EMAIL PROTECTED] Ask me about our current hosting/dedicated server deals! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Managed VPS recommendations
>> So that's a couple of votes for individual people. What company do they >> work for? :-) >> We're not looking for "a guy", we're looking for a firm with a good >> reputation. Then you should avoid 1and1 - they're beyond shit. IMO. And I've not heard good things about Easyspace either. Or rather, I have heard bad things. I'd recommend Dan whom I have a server with, he's helpful. Or you could go for the rather expensive Rackspace, but again their service is top notch. Boxes are dirt cheap nowadays, you'll pay for service. -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated November 1st) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Image Manipulation
At 7:16 PM -0500 11/9/08, Ron Piggott wrote: Is there a way to find out the number of pixels wide and high an image is in PHP? Is there a way to resize an image using PHP? Ron Yes 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] Managed VPS recommendations
On Mon, Nov 10, 2008 at 11:55 AM, Richard Heyes <[EMAIL PROTECTED]> wrote: >>> So that's a couple of votes for individual people. What company do they >>> work for? :-) >>> We're not looking for "a guy", we're looking for a firm with a good >>> reputation. > > Then you should avoid 1and1 - they're beyond shit. IMO. And I've not > heard good things about Easyspace either. Or rather, I have heard bad > things. I'd recommend Dan whom I have a server with, he's helpful. Or > you could go for the rather expensive Rackspace, but again their > service is top notch. Boxes are dirt cheap nowadays, you'll pay for > service. > > -- > Richard Heyes > > HTML5 Graphing for FF, Chrome, Opera and Safari: > http://www.rgraph.org (Updated November 1st) > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > We use Rackspace. They're great. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] It's Sunday, and I'm bored...
> I looked it over briefly and it looks smart for serious collaborated > efforts.. but i ask - is anyone finding it makes sense for one-man shows? Absolutely. Change management and recording makes sense for any development, whether it's one or a thousand people. An example is my RGraph software. I use svn so I don't (and won't) remember what I've changed between releases. It therefore helps to document said changes. And documentation is goood... > (For the time to get up to speed with this maybe I could just pay more > attention to making/naming my own backups?) Doing more backups is a very poor substitute. -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated November 1st) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] object persistence within a session
On Mon, Nov 10, 2008 at 9:47 AM, <[EMAIL PROTECTED]> wrote: > >> But joins are what relation databases excel at, so PHP would be the >> bottleneck in your example. > > Not always... > > If your JOIN can not be easily constrained in the query, until some kind of > processing of the result set takes place, you can end up with a monster > interim result set that will swap the DB server, and send it to its knees. > > For example, if you need a result set of 10 items, some of which (but not > all) relate to a second table, and the left outer join the generates millions > of rows... > > Also: > > SQL is great at many things. > > But something like a tree traversal or other results that depend on the rows > returned can be a real bear, especially for pages that are not your core > scalable must-have part of the site -- Where you don't want to complicate > everything else for just this one admin/report page. > > I'm only saying that, on occasion, the dozen DB calls wins out over a JOIN > that swaps madly. I'm not saying such situations don't exist, but in my experience they are pretty rare -- especially since MySQL added support for subselects. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP and Cyrus problem
Thank's for response. This solution I tried many times but didn't resolved. The reconstruct command don't modify this cyrus.header file. 2008/11/7 Colin Guthrie <[EMAIL PROTECTED]> > Emerson Virti wrote: > >> Where is the problem? >> > > Probably not the right list, but have you tried using cyradm and running: > reconstruct user.name.mailbox.name > > (correct the folder as needed). > > When a cyrus database file gets corrupted or generally borked this fixes it > 99% of the time for me. > > Col > > -- > > Colin Guthrie > gmane(at)colin.guthr.ie > http://colin.guthr.ie/ > > Day Job: > Tribalogic Limited [http://www.tribalogic.net/] > Open Source: > Mandriva Linux Contributor [http://www.mandriva.com/] > PulseAudio Hacker [http://www.pulseaudio.org/] > Trac Hacker [http://trac.edgewall.org/] > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Émerson Salvadori Virti Engenheiro de Computação Mestre em Ciência da Computação [EMAIL PROTECTED]
Re: [PHP] PHP / Procmail / MIME decoder, Imagemagick, MySQL, PDF fax management system
> Are you serious? I've switched to OOo and never looked back. Does > everything I need, and makes styling documents a hell of a lot easier. Absolutely, I've used MSWord for years and know it quite well. So getting along with OpenOffice is just a pain. I'm not an MS zealot though (believe it or not). For example I think Vista is the work of the devil... -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated November 1st) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP / Procmail / MIME decoder, Imagemagick, MySQL, PDF fax management system
On Mon, 2008-11-10 at 09:21 +, Richard Heyes wrote: > >> Surely someone has done this, but I can't find itand I'm too busy and > >> cowardly to write it myself :-) > > Then get your wallet out. If you want email handling (ie Mime > parsing), then the mimeDecode class in PEAR will do this, and put the > resulting data (attachments and all) in an array structure for you to > play with. > > > If that sounds strange, I'm the kind of person who gets annoyed at > > people who put screenshots in MSWord documents! > > Ahh MSWord. Unfortunately I'm stuck with OpenOffice for the time > being, [looks longingly in the direction of MSOffice] > > -- > Richard Heyes > > HTML5 Graphing for FF, Chrome, Opera and Safari: > http://www.rgraph.org (Updated November 1st) > Are you serious? I've switched to OOo and never looked back. Does everything I need, and makes styling documents a hell of a lot easier. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Memcached as Session Handler
Hey list, I run a website that integrates MemCache, MySQL, and PHP sessions very heavily. I recently came across some documentation on the PHP site that informs me that I can use MemCache as the session.save_handler, instead of files. I know there would be no redundancy of the session data with this type of setup, in the event that the MemCache daemon fails. However the website is run on a single server and a single MemCache daemon, with a single IDE HDD. I'm curious as to if anyone else uses MemCache as the session.save_handler? What are the pros and cons of doing this? I figured it would help out with disk I/O and overall performance because MemCache would be much faster than the IDE drive, and I update/reference the $_SESSION data very often. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Reg Ex
Greetings, "Boyd, Todd M.". In reply to Your message dated Friday, October 31, 2008, 17:51:59, > Someone suggested pathinfo() already... and brought up the issues of > extensions < 3 chars and files with no "basename" (i.e., ".htaccess")... > Checked out www.php.net/pathinfo, and ran a demo on my own machine. I > can't test the .htaccess problem, since I'm running Windows (and M$ > won't let you have files that start with "."), but I tested it with > "a.b.c.d" and the extension was returned as "d". Basename was "a.b.c". M$ permissions has nothing to do with your problem. Notepad - File - Save as - .htaccess, File type: All files Here you got it. But it's easier to use more straight tools than stupid explorer. > Sounds like it will do exactly what you are trying to accomplish. For > what it's worth, if I were to do it with a regular expression, I would > use: > $filename = "us.123.kyle.20081029.zip"; > preg_match('/(.*)\..*$/', $filename, $match); I should correct you to #^((.+)(\.[^\.]+)?)$# Results will be 1 => Filename 2 => Basename 3 => Extension -- Sincerely Yours, ANR Daemon <[EMAIL PROTECTED]> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Reg Ex
Greetings, "Diogo Neves". In reply to Your message dated Friday, October 31, 2008, 20:08:25, > It depends on what he really want, but pathinfo really is a better option > My test worked perfectly on files with no extension and without name... File always have name. Extension is a part of it. > var_dump( pathinfo( '.htaccess' )); > var_dump( pathinfo( 'htaccess' )); > die( ); > ?> -- Sincerely Yours, ANR Daemon <[EMAIL PROTECTED]> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] It's Sunday, and I'm bored...
> That's really useful (as I think Richard finds) when I come to do my > timesheets, Me? I don't do time sheets... -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated November 1st) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Memcached as Session Handler
APseudoUtopia wrote: Hey list, I run a website that integrates MemCache, MySQL, and PHP sessions very heavily. I recently came across some documentation on the PHP site that informs me that I can use MemCache as the session.save_handler, instead of files. I know there would be no redundancy of the session data with this type of setup, in the event that the MemCache daemon fails. However the website is run on a single server and a single MemCache daemon, with a single IDE HDD. I'm curious as to if anyone else uses MemCache as the session.save_handler? What are the pros and cons of doing this? I figured it would help out with disk I/O and overall performance because MemCache would be much faster than the IDE drive, and I update/reference the $_SESSION data very often. Well I use it in a multi-server environment. While I don't technically need it in this setup it certainly can help in some circumstances. If you want to expand to a dual server with round-robin DNS load balancing, then memcache will defo help. No idea about benchmarks and performance vs files tho' so can't really help with that! Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] wget --spider and ignore_user_abort(TRUE)
Greetings, Martino Dell'Ambrogio. In reply to Your message dated Tuesday, November 4, 2008, 15:11:45, > - if I use wget --spider (HEAD request) the script exits just after the > first output, all the functions below never get executed It is intended behaviour. Apache sending headers at the moment first body byte sent, and since it is HEAD request, Apache shut down the script in case of request completion (HEADers sent). -- Sincerely Yours, ANR Daemon <[EMAIL PROTECTED]> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: two mysql installations php_mysql.dll extension and libmysql.dll question
Greetings, Daniel Kolbo. In reply to Your message dated Thursday, November 6, 2008, 1:19:50, > This question may be more for the MySQL community. If so, my > apologies, please let me know. > I am using php v 5.2.6. > I have two versions of MySQL running on my server (windows xp home sp3). > MySQL v6 is running on localhost:3306 > MySQL v5.0.41 is running on localhost:3307 > I have two installations of phpmyadmin (latest version 3.0.1.1) to > manage both of these (i am running a local apache 2.2 server on the same > machine on port 8080). Let's call these two installations phpmy5admin > and phpmy6admin. > I am able to login and create tables on both versions of mysql. Thus, i > suspect the installation of both of these is okay. > When i view both phpmyadmin installations it gives me the correct > corresponding mysql version number on the homepage. > However, the phpmy6admin gives me a warning saying: > "Your PHP MySQL library version 5.0.51a differs from your MySQL server > version 6.0.7. This may cause unpredictable behavior." > When i copy the libmysql.dll from the mysql 6 installation directory > into the php directory i get a pop up saying apache must shutdown when > any php script invokes the mysql module. > my windows path variables have > C:\php;C:\Program Files\MySQL > in that order. > my mysql installations are at > C:\Program Files\MySQL\MySQL Server 5.0 > C:\Program Files\MySQL\MySQL Server 6.0 Look, your %PATH% points to nowhere. There's no libMySQL.dll in C:\Program Files\MySQL It should be C:\php;C:\Program Files\MySQL\MySQL Server 6.0\bin at least. > I do suspect the c:\php is being read first, as when i change the > libmysql.dll in this folder, i experience different results. You're right, but it is poor idea to install PHP in C:/php I think :) > I do not have any libmysql.dll files in my system path. that's because your %PATH% is wrong. See above. > My question are: > 1) Is there a libmysql.dll for version 6? If so, where do i get it? Above, look above. I told ya, it's in MySQL /bin directory. > 2) Does libmysql.dll for version 6 only function properly with an > updated php_mysql.dll extension? If so, where do i get this updated > extension? No, it should work well with any server, even 3.23 > 3) If I get the correct library for version 6 working, will i then have > issues running version 5? Shouldn't have any issues, aside from potential bugs of course. > 4) Perhaps I can ignore the warning? (i don't like this option ;) You'd better find it's root and eliminate it. On a side note (not much of a side), I highly recommend to download Mysql Connector/PHP from MySQL site. php_mysql.dll/libmysql.dll shipped with PHP has known bug, which still not fixed in 5.2.6 for me. P.S. Other way of doing this (solving DLL-hell issue, I mean), is what I'm using all the way since... let me guess... 1998 may be. This file being included into Apache httpd.conf: > LoadFile C:/usr/sbin/php-5.2.2-Win32/libeay32.dll > LoadFile C:/usr/sbin/php-5.2.2-Win32/ssleay32.dll > > LoadFile C:/usr/sbin/php-5.2.2-Win32/libmysql.dll > > LoadFile C:/usr/sbin/php-5.2.2-Win32/php5ts.dll > > LoadModule php5_module "C:/usr/sbin/php-5.2.2-Win32/php5apache2_2_filter.dll" > > > php_admin_value extension_dir "C:/usr/sbin/php-5.2.2-Win32/ext" > PHPIniDir "C:/usr/sbin/php-5.2.2-Win32" > That said, I always know which library i've loaded, and if something weird occur, I know who to blame about that. -- Sincerely Yours, ANR Daemon <[EMAIL PROTECTED]> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Managed VPS recommendations
On Mon, 10 Nov 2008 11:30:01 -0500, "Daniel P. Brown" <[EMAIL PROTECTED]> wrote: > On Mon, Nov 10, 2008 at 11:09 AM, Larry Garfield <[EMAIL PROTECTED]> > wrote: >> >> So that's a couple of votes for individual people. What company do they > work for? :-) We're not looking for "a guy", we're looking for a firm with > a good reputation. > > Parasane is a whole company, not just me. I'm just the one who > started it back in 2000 but I wouldn't set you up on a VPS anyway. > I began to refuse to sell those in the last few months because > they're more of a scam than anything. "Hey, let's charge the client > the same amount as a fully-dedicated server - if not more - but put > them on a shared box with limited resources." Exciting. :-) Would you offer what we're looking for on a non-VPS basis? As I said, we're not set on a VPS-based solution. We are set on a reasonably priced service that doesn't complain if we ask for SOAP, cURL, and an opcode cache, and doesn't get cranky if we have a big database. --Larry Garfield -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Managed VPS recommendations
On Mon, Nov 10, 2008 at 4:30 PM, Larry Garfield <[EMAIL PROTECTED]> wrote: > > Exciting. :-) Would you offer what we're looking for on a non-VPS basis? As > I said, we're not set on a VPS-based solution. We are set on a reasonably > priced service that doesn't complain if we ask for SOAP, cURL, and an opcode > cache, and doesn't get cranky if we have a big database. There's no reason to complain; it's a dedicated server, you get dedicated resources. It would be along the same lines of me calling you and whining that you installed Windows on your home PC. I may not like it, but I have no reason to complain --- it's yours. To keep it from looking like a back-and-forth advertising diatribe, though, just zip me a message off-list and we can figure out what you need, what price we could do, etc. And we can figure something out for a 100% fully-managed box, too, Larry, if you guys need it. -- http://www.parasane.net/ [EMAIL PROTECTED] || [EMAIL PROTECTED] Ask me about our current hosting/dedicated server deals! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] file_get_contents urlencode spaces: yeah right?
PHP Version 5.1.6 $contents = file_get_contents("http://user:[EMAIL PROTECTED]/some/path/htmlfile.html"); //WORKS $contents = file_get_contents("http://user:[EMAIL PROTECTED]/some/path/htmlfile with spaces.html"); //FAILS(1) $contents = file_get_contents("http://user:[EMAIL PROTECTED]/some/path/nonhtmlfile.ext"); //WORKS $contents = file_get_contents("http://user:[EMAIL PROTECTED]/some/path/nonhtmlfile with spaces.ext"); //FAILS(2) $contents = file_get_contents(urlencode("http://user:[EMAIL PROTECTED]/some/path/eitherfile with spaces.ext")); //FAILS BUT I DON'T REALLY CARE $contents = file_get_contents(urlencode("http://user:[EMAIL PROTECTED]/some/path/eitherfilenospaces.ext")); //FAILS BUT I DON'T REALLY CARE $contents = file_get_contents("http://user:[EMAIL PROTECTED]/some/path/".urlencode("eitherfile with spaces.ext")); //FAILS WTF(1) $contents = file_get_contents("http://user:[EMAIL PROTECTED]/some/path/eitherfile+with+spaces.ext");//FAILS WTF(2) Warning: file_get_contents(http://[EMAIL PROTECTED]/some/path/eitherfile+with+spaces.ext) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /the/script/index.php on line (the file_get_contents line) Yes, the files are there. file_get_contents docs: Note: If you're opening a URI with special characters, such as spaces, you need to encode the URI with urlencode(). WTF?!?! How do I get FAILS(1) and FAILS(2) to work, in light of FAILS WTF(1) and FAILS WTF(2)? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file_get_contents urlencode spaces: yeah right?
Dee Ayy wrote: > PHP Version 5.1.6 > $contents = file_get_contents("http://user:[EMAIL > PROTECTED]/some/path/htmlfile.html"); > //WORKS > $contents = file_get_contents("http://user:[EMAIL > PROTECTED]/some/path/htmlfile > with spaces.html"); //FAILS(1) > $contents = file_get_contents("http://user:[EMAIL > PROTECTED]/some/path/nonhtmlfile.ext"); > //WORKS > $contents = file_get_contents("http://user:[EMAIL > PROTECTED]/some/path/nonhtmlfile > with spaces.ext");//FAILS(2) > $contents = file_get_contents(urlencode("http://user:[EMAIL > PROTECTED]/some/path/eitherfile > with spaces.ext")); //FAILS BUT I DON'T REALLY CARE > $contents = file_get_contents(urlencode("http://user:[EMAIL > PROTECTED]/some/path/eitherfilenospaces.ext")); //FAILS > BUT I DON'T REALLY CARE > $contents = file_get_contents("http://user:[EMAIL > PROTECTED]/some/path/".urlencode("eitherfile > with spaces.ext")); //FAILS WTF(1) > $contents = file_get_contents("http://user:[EMAIL > PROTECTED]/some/path/eitherfile+with+spaces.ext"); //FAILS > WTF(2) > > > Warning: > file_get_contents(http://[EMAIL > PROTECTED]/some/path/eitherfile+with+spaces.ext) > [function.file-get-contents]: > failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in > /the/script/index.php on line (the file_get_contents > line) > > Yes, the files are there. > > file_get_contents docs: > Note: If you're opening a URI with special characters, such as spaces, > you need to encode the URI with urlencode(). > > WTF?!?! > How do I get FAILS(1) and FAILS(2) to work, in light of FAILS WTF(1) > and FAILS WTF(2)? > > Have you tried to output the result of urlencode and paste the whole thing in a browser to make sure that it works? Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file_get_contents urlencode spaces: yeah right?
My bad. I urlencoded the %20 LOL %20 works. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file_get_contents urlencode spaces: yeah right?
On Mon, Nov 10, 2008 at 5:26 PM, Dee Ayy <[EMAIL PROTECTED]> wrote: > My bad. > > I urlencoded the %20 LOL > > %20 works. > And just in time to go home. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file_get_contents urlencode spaces: yeah right?
Dee Ayy wrote: > PHP Version 5.1.6 > $contents = file_get_contents("http://user:[EMAIL > PROTECTED]/some/path/htmlfile.html"); > //WORKS > $contents = file_get_contents("http://user:[EMAIL > PROTECTED]/some/path/htmlfile > with spaces.html"); //FAILS(1) > $contents = file_get_contents("http://user:[EMAIL > PROTECTED]/some/path/nonhtmlfile.ext"); > //WORKS > $contents = file_get_contents("http://user:[EMAIL > PROTECTED]/some/path/nonhtmlfile > with spaces.ext");//FAILS(2) > $contents = file_get_contents(urlencode("http://user:[EMAIL > PROTECTED]/some/path/eitherfile > with spaces.ext")); //FAILS BUT I DON'T REALLY CARE > $contents = file_get_contents(urlencode("http://user:[EMAIL > PROTECTED]/some/path/eitherfilenospaces.ext")); //FAILS > BUT I DON'T REALLY CARE > $contents = file_get_contents("http://user:[EMAIL > PROTECTED]/some/path/".urlencode("eitherfile > with spaces.ext")); //FAILS WTF(1) > $contents = file_get_contents("http://user:[EMAIL > PROTECTED]/some/path/eitherfile+with+spaces.ext"); //FAILS > WTF(2) > > > Warning: > file_get_contents(http://[EMAIL > PROTECTED]/some/path/eitherfile+with+spaces.ext) > [function.file-get-contents]: > failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in > /the/script/index.php on line (the file_get_contents > line) > > Yes, the files are there. > > file_get_contents docs: > Note: If you're opening a URI with special characters, such as spaces, > you need to encode the URI with urlencode(). > > WTF?!?! > How do I get FAILS(1) and FAILS(2) to work, in light of FAILS WTF(1) > and FAILS WTF(2)? > Try replacing the '+' signs with %20. Worked for me. I had the same results as you on my server. The only fix I found was to replace the + with %20. Maybe the user agent & server are doing something special that file_get_contents() & server are not doing. -- Jim Lucas "Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them." Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file_get_contents urlencode spaces: yeah right?
> Have you tried to output the result of urlencode and paste the whole > thing in a browser to make sure that it works? The FF 3.0.3 browser likes http://user:[EMAIL PROTECTED]/some/path/eitherfile with spaces.ext and http://user:[EMAIL PROTECTED]/some/path/eitherfile%20with%20spaces.ext but NOT http://user:[EMAIL PROTECTED]/some/path/eitherfile+with+spaces.ext like Jim Lucas said. Any thoughts on agent or server settings? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file_get_contents urlencode spaces: yeah right?
Dee Ayy wrote: On Mon, Nov 10, 2008 at 5:26 PM, Dee Ayy <[EMAIL PROTECTED]> wrote: My bad. I urlencoded the %20 LOL %20 works. And just in time to go home. Thanks. if you use rawurlencode() instead of urlencode() this won't be a problem; since that does change spaces to %20 instead of +. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file_get_contents urlencode spaces: yeah right?
Jim Lucas wrote: Dee Ayy wrote: PHP Version 5.1.6 $contents = file_get_contents("http://user:[EMAIL PROTECTED]/some/path/htmlfile.html"); //WORKS $contents = file_get_contents("http://user:[EMAIL PROTECTED]/some/path/htmlfile with spaces.html");//FAILS(1) $contents = file_get_contents("http://user:[EMAIL PROTECTED]/some/path/nonhtmlfile.ext"); //WORKS $contents = file_get_contents("http://user:[EMAIL PROTECTED]/some/path/nonhtmlfile with spaces.ext"); //FAILS(2) $contents = file_get_contents(urlencode("http://user:[EMAIL PROTECTED]/some/path/eitherfile with spaces.ext"));//FAILS BUT I DON'T REALLY CARE $contents = file_get_contents(urlencode("http://user:[EMAIL PROTECTED]/some/path/eitherfilenospaces.ext")); //FAILS BUT I DON'T REALLY CARE $contents = file_get_contents("http://user:[EMAIL PROTECTED]/some/path/".urlencode("eitherfile with spaces.ext"));//FAILS WTF(1) $contents = file_get_contents("http://user:[EMAIL PROTECTED]/some/path/eitherfile+with+spaces.ext"); //FAILS WTF(2) Warning: file_get_contents(http://[EMAIL PROTECTED]/some/path/eitherfile+with+spaces.ext) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /the/script/index.php on line (the file_get_contents line) Yes, the files are there. file_get_contents docs: Note: If you're opening a URI with special characters, such as spaces, you need to encode the URI with urlencode(). WTF?!?! How do I get FAILS(1) and FAILS(2) to work, in light of FAILS WTF(1) and FAILS WTF(2)? Try replacing the '+' signs with %20. Worked for me. Or use http://www.php.net/rawurlencode -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php