Re: [PHP] Using Header() to pass information...
On Sat, April 22, 2006 10:15 am, Todd Cary wrote: >if ($send) > header("location: mypage.php?message=" . $message); > > the data ($message) is passed in the URL. Is there a way to pass > the data as though it was a POST method i.e. not in the URL? Without copying and pasting a lot of bits and pieces from four other posts... #1. Cramming stuff into $_POST is probably NOT a good idea, just on general principle, that $_POST is supposed to have the stuff in it that came from the browser. If you are doing your sanitization/filtering/validation correctly, you shouldn't even be READING $_POST after the first 3 lines of your PHP code anyway. (Okay, maybe first 10 lines.) #2. Definitely don't try to use Location: without the full http:// URL You are only asking for grief. #3. If the mypage.php is on your own computer, you would probably be MUCH better off to just include it instead of the other options given. While you CAN cram the data into a $_SESSION and then send your Location:, think about what that does: 1. Writes a bunch of data to hard drive in $_SESSION Or to your db, which ends up on your hard drive anyway, most likely. Okay, this bit could get real complicated and picuyane, but let's just agree that it uses up not insignificant resources, no matter what your session back-end. 2. Sends a response to the browser telling it to go look somewhere else. 3. The browser then has to request a new URL. 4. That then hits your HTTP server again, using up another HTTP connection. 5. The web server then reads... mypage.php and executes it. So, you can do all that, or you can skip to step 5 with an include. Call me silly, but skipping steps 1 through 4, and not wasting all those resources, sounds like a Good Idea to me. You might maybe have to re-structure your application a bit. Maybe mypage.php has to be re-written to not use $_POST necessarily, but to use $_POST or some OTHER array, if that other array is defined. But, still, your server will be a lot more zippy if you don't sprinkle all these header("Location: ...") calls all over the place. The other suggestion, of opening up a socket and doing the POST and returning the data is good, *IF* mypage.php isn't on your server, and you do not have an API from whomever provides that content. Opening up a socket on your own server to POST data to yourself instead of just doing an include... Well, it's not as bad as the preceding, since your network lag is negligible when a machine talks to itself, but you're still wasting HTTP and socket resources, so that you can coax the web-server into reading and executing a PHP file, when, again, you can just do step 5. Disclosure: When I first figured out the Location: header, I thought it was really cool, and was going to structure my MVC (sort of, though I had no idea it was called MVC then) application around that... The longer you use header("Location: ...") the more you realize how it's just not a substitute for a well-structured web application. Just my 2 cents. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sorting troubles
On Sat, April 22, 2006 4:49 am, William Stokes wrote: > I have a column in DB that contains this kind of data, > A20,B16,B17C14,C15,D13,D12 etc. > > I would like to print this data to a page and sort it ascending by the > letter an descending by the number. Can this be done? Like > > A20 > B17 > B16 > C15 > C14 > D13 > D12 I personally would do it in SQL, since SQL has been specifically fine-tuned for about 4 decades to do this [bleep] fast, while PHP has not: select col from DB order by substring(col, 1, 1), substring(col, 2) You could also consider creating a "view" in your DB, if your DB supports views. If not, and the dataset is VERY large, and/or your particular database does not allow a function in ORDER BY clauses, I would suggest you add two indexed fields and break that one column up into two. You'd need to add some kind of logic somewhere (triggers in the DB, application logic, whatever) to manage the copying of the data from the column to the other. No matter how you slice it, though, the LAST option I'd use would be to use http://php.net/usort to sort the data from a DB in PHP. Still, it's an option, if your DB is particularly broken, to the point where none of the above apply. I don't think any such DB exists with PHP support, unless maybe via ODBC, but I may as well provide the complete answer, eh? -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using Header() to pass information...
On Tue, April 25, 2006 2:12 am, Richard Lynch wrote: I left out some steps... > 1. Writes a bunch of data to hard drive in $_SESSION > Or to your db, which ends up on your hard drive anyway, most likely. > Okay, this bit could get real complicated and picuyane, but let's just > agree that it uses up not insignificant resources, no matter what your > session back-end. > 2. Sends a response to the browser telling it to go look somewhere > else. > 3. The browser then has to request a new URL. > 4. That then hits your HTTP server again, using up another HTTP > connection. 4a. Initialize the session again 4b. Read the session data > 5. The web server then reads... mypage.php and executes it. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cURL & cookies
On Sat, April 22, 2006 3:12 am, Peter Hoskin wrote: > I'm trying to produce an sms sending script, however having problems > with curl and storing cookies. The login page works fine, however the > second http request returns a login page rather than authenticated > content. Additionally, in the headers a different cookie value for > JSESSIONID is set. > > I'm running PHP/5.1.2 on FreeBSD > > This script: > define('COOKIEJAR','/path/to/curl-cookiejar'); > define('USERAGENT','Mozilla/4.0 (compatible; MSIE 6.0; Windows NT > 5.1)'); > > > $ch = curl_init(); > curl_setopt($ch, CURLOPT_COOKIEJAR, COOKIEJAR); . . . > $return['login'] = curl_exec($ch); > curl_close($ch); > unset($ch); > > $ch = curl_init(); > curl_setopt($ch, CURLOPT_COOKIEFILE, COOKIEJAR); Here, you should also use CURLOPT_COOKIEJAR and COOKIEJAR, in case you get some *MORE* cookies on subsequendc pages. In fact, go ahead and just use both options all the time -- assuming your COOKIEFILE starts off empty. Or perhaps you should http://php.net/unlink it at the beginning. > $fp = fopen(COOKIEJAR,'w'); > fclose($fp); Ah. This is to wipe out the COOKIEJAR when you're done, right?... If not, get rid of it. Oh, and here's the REAL problem: If you use CURLOPT_HEADER, 1, then, like, for some reason beyond my ken, the COOKIEJAR/COOOKIEFILE stuff just plain doesn't get done. This really sucks if you need *other* headers and want curl to manage the Cookies for you, but there it is. I'm not sure if I remembered to file a bug report on that or not... If the general conscensus on this list is that CURLOPT_HEADER "on" should not negate the use of CURLOPT_COOKIEFILE and/or CURLOPT_COOKIEJAR, then we may want to file a bug report... But I strongly suspect that bug report would most correctly go to curl, and not PHP, since I doubt that PHP does anything to screw this up -- it's probably all in curl itself, no? Or maybe me and Peter are the only 2 guys on the planet that think you should get to have both... -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Standard style of writing your code
Chcek out the PEAR site for a pretty good style, but then again it is a matter of preference and I code any way I choose unless I am working within a team where some kind of consistency makes sense. On 25/04/06, Martin Zvarík <[EMAIL PROTECTED]> wrote: > > Hi, > I see everyone has its own way of writing the code. If there is 10 > programmers working on same thing, it would be good if they would have > same style of writing the PHP code. > > So, my question is: Is there anything what would define standard style > of writing PHP code? > > Thanks, > Martin > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- http://www.web-buddha.co.uk dynamic web programming from Reigate, Surrey UK (php, mysql, xhtml, css) look out for project karma, our new venture, coming soon!
Re: [PHP] list noise [WAS: How to find tag and get src of image]
Don't know about the postgre list. But answers to such questions can easilly be found on the web. Just use google or RTFM. I answered because i like to help. Hope it was helpfull :) But i can also understand the laughter/frsustration. Don't take it to personal. They just encourage you to RTFM. Best practise and best way to learn. Let them help with real problems and not something you can easily find yourself. This list is great! grt, Thijs > On Mon April 24 2006 9:54 pm, Paul Novitski wrote: >> Rushed, grumpy defender of the underdog, >> >> Paul > >>For those of you who are making a joke out of my question, glad to have >>given you all a laugh. I want to thank everyone else for being so nice >> and >>helpful to beginners. > >>Lisa > > > I am not an active participant in this list. But I learn a lot just > reading > the messages. I also read messages in pgsql-general@postgresql.org . > There, > even stupid, unresearched questions get serious answers with just gentle > nudges. > > Just follow this thread. The question was: > > Quote: > Subject: to know > > Message: > hello guys, > what do u think about the near future of postgre? > what is the latest version of postgre? and how it differ from the oldone? > who is the leading person on postgre? > Unquote > > http://archives.postgresql.org/pgsql-general/2006-04/msg01018.php > > Have a look at the replies. A study in good manners. > > Best regards, > > > Ma Sivakumar > > > -- > Integrated Management Tools for leather industry > -- > http://www.leatherlink.net > > Ma Siva Kumar, > BSG LeatherLink (P) Ltd, > IT Solutions for Leather Industry, > Chennai - 600087 > Tel : +91 44 55191757 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Standard style of writing your code
> Hi, > I see everyone has its own way of writing the code. If there is 10 > programmers working on same thing, it would be good if they would have > same style of writing the PHP code. > > So, my question is: Is there anything what would define standard style > of writing PHP code? > > Thanks, > Martin > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Read the PEAR coding standards : http://pear.php.net/manual/en/standards.php Think coding style is personal for everybody. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sorting troubles
Thanks for your input everyone! The easiest way to do this was ansding this to the SELECT clause: select col from DB order by substring(col, 1, 1) ASC, substring(col, 2) DESC Seems to work fine. -Will ""Richard Lynch"" <[EMAIL PROTECTED]> kirjoitti viestissä:[EMAIL PROTECTED] > On Sat, April 22, 2006 4:49 am, William Stokes wrote: >> I have a column in DB that contains this kind of data, >> A20,B16,B17C14,C15,D13,D12 etc. >> >> I would like to print this data to a page and sort it ascending by the >> letter an descending by the number. Can this be done? Like >> >> A20 >> B17 >> B16 >> C15 >> C14 >> D13 >> D12 > > I personally would do it in SQL, since SQL has been specifically > fine-tuned for about 4 decades to do this [bleep] fast, while PHP has > not: > > select col from DB order by substring(col, 1, 1), substring(col, 2) > > You could also consider creating a "view" in your DB, if your DB > supports views. > > If not, and the dataset is VERY large, and/or your particular database > does not allow a function in ORDER BY clauses, I would suggest you add > two indexed fields and break that one column up into two. > > You'd need to add some kind of logic somewhere (triggers in the DB, > application logic, whatever) to manage the copying of the data from > the column to the other. > > No matter how you slice it, though, the LAST option I'd use would be > to use http://php.net/usort to sort the data from a DB in PHP. Still, > it's an option, if your DB is particularly broken, to the point where > none of the above apply. I don't think any such DB exists with PHP > support, unless maybe via ODBC, but I may as well provide the complete > answer, eh? > > -- > Like Music? > http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Standard style of writing your code
- Original Message - From: "Richard Lynch" <[EMAIL PROTECTED]> On Tue, April 25, 2006 12:51 am, Martin Zvarík wrote: I see everyone has its own way of writing the code. If there is 10 programmers working on same thing, it would be good if they would have same style of writing the PHP code. So, my question is: Is there anything what would define standard style of writing PHP code? Yes, but... You can lock down every single little nuance of PHP style and document it all somewhere and require that all 10 programmers use THAT style. There are two possible outcomes to this: #1. Somebody actually enforces this document, and makes themselves REAL unpopulare, and probably all 10 programmers very unhappy, and they all quit. #2. Nobody actually enforces it; nobody follows it; you wasted time making it. The best general rule is probably to follow the style the original author used, as much as possible, when adding to or changing a file. The differences between placement of { and newlines and spaces and parentheses are pretty much a religious argument, not a technical argument, no matter how much people try to claim one is superior for readability. Hmmm. It would be Really Nifty if some fancy IDE out there would automatically render one's PHP code in the style preferred by the developer... So no matter what was actually typed, *I* would see: function foo ($x) { //body } but some heretic who doesn't know any better would see: function foo($x) { //body } Now *THAT* would be a feature worth paying for in an IDE! :-) Forget the stupid color-coding of the fucntions and all that crap. Gimme the code layout I want! -- The Php compiler http://www.phpcompiler.org/ might help you with reformatting. Look at: http://www.phpcompiler.org/doc/convertingphp.html. If you add no extra code to the compiler, it will produce a reformatted version of the original. I don't know it your IDE allows it but in the plain editor I use I could assign an external program to run, modify the source in the foreground and reload it once done. Satyam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Serveral forms in a page.
Hello, This "might be" more HTML stuff but anyway... I have several forms in a page which is ok otherwise but the reset buttons doesn't clear anything that is queried from DB and printed to the text fields. Any idea how to create Reset buttons that clear the fields even when the data is not from user input? Or do I have to create reset buttons that are actually submit buttons and play with variables after that or something like that? Javascript is the way I don't want to go... Thanks -Will -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Serveral forms in a page.
William Stokes wrote: Hello, This "might be" more HTML stuff but anyway... Yeah, anyway who cares if it belongs in here or not. I have several forms in a page which is ok otherwise but the reset buttons doesn't clear anything that is queried from DB and printed to the text fields. Any idea how to create Reset buttons that clear the fields even when the data is not from user input? Or do I have to create reset buttons that are actually submit buttons and play with variables after that or something like that? Javascript is the way I don't want to go... Yeah very nice cars can you get in Ohio. Ever been there? Ah, what? It doesn't belong to your post? Ah shame on me, but anyway ... cookie? -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shopping carts
Richard Lynch wrote: PURISTS READRS SHOULD DELETE THIS NOW!!! On Mon, April 24, 2006 2:31 am, Jochem Maas wrote: cheers Richard! you brightened up my monday morning. the badger reference will keep me going till wednesday ;-) badger? you wrote 'baggers', I read 'badgers' - where I grew up all good jokes included a badger ;-) put it down to filtered perception. Where do you do your shopping?... :-) farmers market, middle-of-bloody-no-where, some where in england, long time ago - (that makes as much sense to me as it does to you) While we're on the topic... What's the difference between a dozen eggs and an elephant... er? 2 metrics tons? no? put me out of my misery then :-) Remind me NEVER to send you to the store for a dozen eggs! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Serveral forms in a page.
William Stokes wrote: > Hello, > > This "might be" more HTML stuff but anyway... > > I have several forms in a page which is ok otherwise but the reset buttons > doesn't clear anything that is queried from DB and printed to the text > fields. Any idea how to create Reset buttons that clear the fields even > when the data is not from user input? Or do I have to create reset buttons > that are actually submit buttons and play with variables after that or > something like that? Javascript is the way I don't want to go... > > Thanks > -Will This _is_ more HTML... The Reset feature resets the form to the information that was loaded - it doesn't 'clear' the form. Cheers -- David Robley If brains were dynamite you couldn't blow your nose! Today is Setting Orange, the 42nd day of Discord in the YOLD 3172. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] phpmailer problem with spam score
Hi there, I am operating page where user receive a message which they do have to confirm. The message does have about 5 links inside to give the user administration to his postings. Now recently I discovered that the message does not go through to everybody since the spam score is 4.2! This is of course not what I want as some users are not able to confirm their postings without this e-mail. I am using the newest phpmailer class available and this is what the header tells me: X-Spam: high X-Spam-score: 4.2 X-Spam-hits: BAYES_50, EXTRA_MPART_TYPE, FORGED_RCVD_HELO, HTML_MESSAGE, HTML_TAG_BALANCE_BODY, MIME_HTML_MOSTLY, SARE_OBFU_PART_ING Is there something I can do about this? Thank you for any suggestions. Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: phpmailer problem with spam score
Merlin wrote: Hi there, I am operating page where user receive a message which they do have to confirm. The message does have about 5 links inside to give the user administration to his postings. Now recently I discovered that the message does not go through to everybody since the spam score is 4.2! This is of course not what I want as some users are not able to confirm their postings without this e-mail. I am using the newest phpmailer class available and this is what the header tells me: X-Spam: high X-Spam-score: 4.2 X-Spam-hits: BAYES_50, EXTRA_MPART_TYPE, FORGED_RCVD_HELO, HTML_MESSAGE, HTML_TAG_BALANCE_BODY, MIME_HTML_MOSTLY, SARE_OBFU_PART_ING Is there something I can do about this? Thank you for any suggestions. Merlin - Tell the people to put your domain on the whitelist or the specific mailadress it comes from. - Use plaintext only mails The scroe is so high because of the links. Greets Barry -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: C&C [PHP] PHP Standard style of writing your code
""Nicolas Verhaeghe"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Another good thing to remember is that English is our common language and that it is usually a good practice to give variables an English name. . . if ($car == 'Audi') {$vorsprung_durch_technik = 'GOOD!';} else {$vorsprung_durch_technik = 'BAD!';};-) . . . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Serveral forms in a page.
Mulkku? "Barry" <[EMAIL PROTECTED]> kirjoitti viestissä:[EMAIL PROTECTED] > William Stokes wrote: >> Hello, >> >> This "might be" more HTML stuff but anyway... > Yeah, anyway who cares if it belongs in here or not. > >> I have several forms in a page which is ok otherwise but the reset >> buttons doesn't clear anything that is queried from DB and printed to the >> text fields. Any idea how to create Reset buttons that clear the fields >> even when the data is not from user input? Or do I have to create reset >> buttons that are actually submit buttons and play with variables after >> that or something like that? Javascript is the way I don't want to go... > > Yeah very nice cars can you get in Ohio. > Ever been there? > > Ah, what? It doesn't belong to your post? > Ah shame on me, but anyway ... > cookie? > -- > Smileys rule (cX.x)C --o(^_^o) > Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to convert a string( "23/04/2006") to a string "23042006" in javascript?
Hi you! I am a newbie to web programming, I have a following problem: I have a string: "23/04/2006", want to convert it become 23042006 in javascript. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to convert a string( "23/04/2006") to a string "23042006" in javascript?
On 25 Apr 2006, at 10:59, Pham Huu Le Quoc Phuc wrote: I am a newbie to web programming, I have a following problem: I have a string: "23/04/2006", want to convert it become 23042006 in javascript. If it always follows that notation you could just strip out the / character (str_replace) Cheers, Rich -- http://www.corephp.co.uk Zend Certified Engineer PHP Development Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How to convert a string( "23/04/2006") to a string "23042006" in javascript?
Pham Huu Le Quoc Phuc wrote: Hi you! I am a newbie to web programming, I have a following problem: I have a string: "23/04/2006", want to convert it become 23042006 in javascript. Thanks. YOU! Hi! And you are a newbie to mailing lists as it seems. This is a PHP mailing list so only stuff related to PHP should be asked. You are having a problem with JAVASCRIPT so you should ask in a JAVASCRIPT mailing list or either start reading MANUALS and DOCUMENTATIONS because they provide LOTS of INFORMATION about the things you are SEARCHING for. But i will give you a hint: replace() Barry -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: phpmailer problem with spam score
On Tue, 2006-04-25 at 11:47 +0200, Barry wrote: > - Tell the people to put your domain on the whitelist or the specific >mailadress it comes from. > - Use plaintext only mails > > The scroe is so high because of the links. Also, remember to put in a Reply-To header. A lot of SPAM software will flag or delete a message with no reply to address. The Reply-To address should also be a valid one, in the case of a reverse domain lookup on some hosts. Better to cover all your bases in that regard. --Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] At Last!
""Nicolas Verhaeghe"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Well, first of all, try to post in plain text. Second, yes, it's a good thing to learn to use your Outlook Express before joining a mailing list. #1 I do post in plain text #2 The problem wasn't with OE, it was with the server not accepting the posts (because it hadn't been made clear that you had to register an email address before the server would accept posts from that address - DUH! :-) Now all I need to find out is how to NOT keep getting the email digests (It seems likely that if I unsubscribe from the list [in order to not get the mailings] I will not then be able to post via NNTP... 8>) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] At Last!
Porpoise wrote: ""Nicolas Verhaeghe"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Well, first of all, try to post in plain text. Second, yes, it's a good thing to learn to use your Outlook Express before joining a mailing list. #1 I do post in plain text #2 The problem wasn't with OE, it was with the server not accepting the posts (because it hadn't been made clear that you had to register an email address before the server would accept posts from that address - DUH! :-) Now all I need to find out is how to NOT keep getting the email digests (It seems likely that if I unsubscribe from the list [in order to not get the mailings] I will not then be able to post via NNTP... 8>) I think you can login with your email address and change your subscription options, but I might be speaking under correction. HTH Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: phpmailer problem with spam score
Paul Scott schrieb: On Tue, 2006-04-25 at 11:47 +0200, Barry wrote: - Tell the people to put your domain on the whitelist or the specific mailadress it comes from. - Use plaintext only mails The scroe is so high because of the links. Also, remember to put in a Reply-To header. A lot of SPAM software will flag or delete a message with no reply to address. The Reply-To address should also be a valid one, in the case of a reverse domain lookup on some hosts. Better to cover all your bases in that regard. --Paul HI there, thank you all for the info. I believe that is should be possible to send html e-mails containing links that have a spam score of 0 as for example news.com does this. Just need to find out how :-) Does anybody know how phpmailer sents its messages out by default? I believe it does this via the php function mail. But there can also be a smtp server specified. Do I have to set up such a server, or is it running by default on suse servers? If I issue a "top" command I do see smtp processes. What would be the advantage? Thank you for any help, Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shopping carts
> > > > While we're on the topic... > > > > What's the difference between a dozen eggs and an > elephant... > > er? 2 metrics tons? no? put me out of my misery > then :-) > If you dont know I am not going to send you to the store for a dozen eggs... Didnt know we had elephant joke fans here...heres a few: 1) Why can't you get an Elephant to screw in a lightbulb? 2)What the difference between a herd of Elephants and a bunch af grapes? 3)What did the peanut say to the elephant? 4)Why did the elephant fall out of the tree? 5)Why did the second elephant fall out of the tree? 6)Why did the third elephant fall from of the tree? 7)What is gray and has four legs and a trunk? Cheers! -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: phpmailer problem with spam score
Merlin wrote: Paul Scott schrieb: I believe that is should be possible to send html e-mails containing links that have a spam score of 0 as for example news.com does this. Not sure about spam score 0 but you can reduce it to negligible. Does anybody know how phpmailer sents its messages out by default? On *nix, it uses sendmail command/wrapper to send mails by default. You can specify the path to sendmail, port, from etc. in php.ini I believe it does this via the php function mail. But there can also be a smtp server specified. No. In PHP mail function, you cannot specify server. Do I have to set up such a server, or is it running by default on suse servers? Linux server distros have mail server. Make sure you have a mail server daemon running. If I issue a "top" command I do see smtp processes. It would be advisable to use SMTP class found here: http://phpmailer.sourceforge.net/. This one would allow you use mail server and do many other things you may need. -- Sameer N. Ingole Blog: http://weblogic.noroot.org/ --- Better to light one candle than to curse the darkness. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] list noise [WAS: How to find tag and get src of image]
Hi guys, RTFM answers with links to the info are fine. I neverminded something like RTFM http://www.php.net/switch. I have found that finding the easier answers can be the most difficult. I have been doing PHP for > 3 years. Sometimes there is something simple about a function I cannot quite get. How does an RTFM answer help? It does not. An answer with the link, or exact google keywords is always more helpfull. >From pressing a few posters of RTFM answers in other projects' forums I have found out two things: 1) most of them are script kiddies. 2) most of them do not know the answer. They think it is more fun to post the RTFM than to not respond. -- Leonard Burton, N9URK [EMAIL PROTECTED] "The prolonged evacuation would have dramatically affected the survivability of the occupants." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shopping carts
I am anxiously awaiting the answers!.g0g0g0g0g0!! On Apr 25, 2006, at 7:26 AM, Ryan A wrote: 1) Why can't you get an Elephant to screw in a lightbulb? 2)What the difference between a herd of Elephants and a bunch af grapes? 3)What did the peanut say to the elephant? 4)Why did the elephant fall out of the tree? 5)Why did the second elephant fall out of the tree? 6)Why did the third elephant fall from of the tree? 7)What is gray and has four legs and a trunk? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [ Way Too OT] Jokes [was: shopping carts]
Philip Thompson wrote: I am anxiously awaiting the answers!.g0g0g0g0g0!! Me too. May be OP of Questions should tell the answers now.. On Apr 25, 2006, at 7:26 AM, Ryan A wrote: 1) Why can't you get an Elephant to screw in a lightbulb? 2)What the difference between a herd of Elephants and a bunch af grapes? 3)What did the peanut say to the elephant? 4)Why did the elephant fall out of the tree? 5)Why did the second elephant fall out of the tree? 6)Why did the third elephant fall from of the tree? 7)What is gray and has four legs and a trunk? -- Sameer N. Ingole Blog: http://weblogic.noroot.org/ --- Better to light one candle than to curse the darkness. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session Array Disappears
Richard Lynch wrote: I'm thinking the guy who suggested ignore_user_abort(TRUE) is just doing Voodoo Programming :-) It may or may not be something you want, but I doubt it will have any affect whatsoever on your posted problem. Actually, I think anywhere that somebody thinks they need ignore_user_abort, they probably should re-structure the application to handle the long-running process in a cron job or some other asynchronous manner, rather than try to keep a script running tied to an HTTP connection that isn't useful anymore. In other words: Move the long-running slow heavy lifting computation OUT of the web page generation part, so that your user gets a web page super fast in the first place, and so the long-running part can get done later, when the user isn't stuck waiting around for it. Your basic Human Interface principle, which is apparently going to be called Web 2.0 now. :-) On Mon, April 24, 2006 9:09 pm, Webmaster wrote: Hello, Thank you for the reply. Interesting function. I have not heard of that one previously. I've read the manual pages for it.If I understand ignore_user_abort(TRUE)...you are thinking that maybe the user is being disconnected (using stop button or having ISP issues) prior to the script finishing and therefore the script does not have a chance to create the array? I'm wondering if that would be true, since later in the same script, it generates an email to inform me someone's submission was lost because the array did not exist. I'm confused how it could stop executing the middle of the script (step 4a and 5 below) but yet execute the end of the script (the final step in the code below)? I was first made aware of this issue because of the email, so I think the end of the script is executing. Thanks, R Al wrote: add a ignore_user_abort(TRUE) first thing in your code. Hello, The site I'm working on works like this... Requires a login that uses sessions to remember username and email address. Upon being verified, the user is presented with a page that displays several questions regarding their background. Upon submitting the background page, a script checks to make sure all background questions were answered. If not, the page is redisplayed with a warning to answer all questions. If they are all present, a second page is displayed asking about a specific topic. Submitting the second page calls up the code provided below. In reading the www.php.net/manual/en/ref.session.php page, I'd like to point out we do not use cookies. The session id is propagated in the URL (although it's not visible in the URL bar). Also, session.gc_maxlifetime is set to 5400. We are using PHP 4.3.4. Not very often, but once in a while, I'll get an email warning me that a submission was denied because $_SESSION['Q'] is empty. I'm wondering, hoping and/or praying that someone out there can look at this small script and let me know if I'm doing something wrong with the built in function array_pop, perhaps I don't understand sessions at all or perhaps it is a server issue. It's very confusing because other session variables (name and email from the login page) are not emptied, just $_SESSION['Q']. Here's my code with some documentation: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Richard: normally your advice is good and you've helped me several times in the past. However, I'm not sure you are correct this time. I've had great success for programs that have my users uploading image files. Prior to adding ignore_user_abort(TRUE) they became impatient and closed the connection, thus truncating the process. The docs say explicitly in "Connection handling" "If you do not tell PHP to ignore a user abort and the user aborts, your script will terminate." All that having been said, adding ignore_user_abort(TRUE) won't hurt a thing and may solve his problem. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New image already cached. (SOLVED)
At 9:56 PM -0500 4/23/06, Richard Lynch wrote: On Sun, April 23, 2006 5:25 pm, tedd wrote: Neither the image tag nor the file cares if there is a random number attached to the file's url. But, by doing this, most (perhaps all) browsers think the image name is unique. Doe anyone see any problems with this? Oh, all the browsers will KNOW it's a unique URL... But some of them won't believe it's a valid image. :-( Alas, I do not recall which browser would mess this up -- And it's probably so old MOST webmasters won't care... I ran a test through BrowserCam and surprisingly the ONLY browser that failed to recognize the url as a valid image was Netscape 4.78 for W2K. But, that browser is ancient. So, it works! tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shopping carts
Ryan A wrote: 1) Why can't you get an Elephant to screw in a lightbulb? Because it's an elephant 2)What the difference between a herd of Elephants and a bunch af grapes? The grapes are purple. 3)What did the peanut say to the elephant? Nothing. Peanuts can't talk. 4)Why did the elephant fall out of the tree? Because he was dead 5)Why did the second elephant fall out of the tree? Because he was glued to the first elephant 6)Why did the third elephant fall from of the tree? He thought it was some sort of a game 7)What is gray and has four legs and a trunk? A mouse going on vacation. *showing my age -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session Array Disappears
Hello, Thank you for the reply. Richard Lynch wrote: On Mon, April 24, 2006 2:48 pm, Webmaster wrote: In reading the www.php.net/manual/en/ref.session.php page, I'd like to point out we do not use cookies. The session id is propagated in the URL (although it's not visible in the URL bar). Something is very odd here... Unless the session data is being passed as an INPUT TYPE="hidden" in a FORM, it has to be in the URL to work. It should be visible in the URL bar if it's in the URL. Though, obviously, the thing works, so it's not your "problem" here... It's just something you should investigate for your own learning experience, rather than to solve your problem today. I apologize, I should have been more clear, and I should have thought a little more before describing the situation. Users navigate from page to page by use of a submit button. They do not use links to go from page to page. Not very often, but once in a while, I'll get an email warning me that a submission was denied because $_SESSION['Q'] is empty. I'm wondering, //Start building the final Session Array // Step 4a $_SESSION['Q'] = array($testVersion); //Populate rest of Session Array // Step 5 for ($newBGQCounter=0; $newBGQCounter This is the source of your troubles. Step 4a is pointless. Try this in a small test file: Per your suggestions, here's a couple of tests I ran and the results I received: Results: Array ( [0] => a [1] => b ) (desired result, basically what I'm using now) Results: ab (treats it like a string instead of an array, undesired result) Results: Array ( [0] => Array ( [0] => a ) [1] => b ) (creates multi-dimensional array, undesired result) Results: Array ( [0] => 1 [1] => 2 ) (desired result) According to these tests, I could use the first example or the last example to achieve the desired results. //test for existense of session array elements if ( ($_SESSION['Q'][0] == "") OR ($_SESSION['Q'][1] == "") OR ($_SESSION['Q'][2] == "") OR ($_SESSION['Q'][3] == "") OR ($_SESSION['Q'][4] == "") OR ($_SESSION['Q'][5] == "") OR ($_SESSION['Q'][6] == "") OR ($_SESSION['Q'][7] == "") OR ($_SESSION['Q'][8] == "") OR ($_SESSION['Q'][9] == "") ) { SEND ME AN ERROR EMAIL It might be a Good Idea for this error email to dump out ALL of $_SESSION['Q'] as well as all the variables you think are involved in your problem. You would then be able to backtrack and debug this issue in the future. I agree. I actually realized this yesterday after I sent my email to the list. I'm in the process of adjusting the code to include variables in the email. Thank you for the suggestion(s). They are greatly appreciated. At this point, here's my "logical" thinking 1. Occassionaly, the background information session array is missing one or more elements thus an email is generated and the script ends immediately. 2. In the email portion of the script, which is after the array element check, I call other session variables (username, email address) and they are present. 3. Given the above information, I'm inclined to believe that it's got something to do with just the background information session array. 3a. Perhaps array_pop is the problem, it works differently then I thought?.?. 3b. Perhaps the way I construct the session array corrupts it (using a "for" loop)?.?. 4. Perhaps session variables are not really intended to contain arrays?.?. 5. I'm not sure if any user interactions (web accelerator, ISP issues or Forward/Back/Reload browser buttons) would cause such an issue?.?. Looking at the above list, I can only deal with item 3. I could change my session array code to populate it like this: $_SESSION['Q'][0] = $testVersion; $_SESSION['Q'][1] = $thisQarray[0]; $_SESSION['Q'][2] = $thisQarray[1]; $_SESSION['Q'][3] = $thisQarray[2]; $_SESSION['Q'][4] = $thisQarray[3]; $_SESSION['Q'][5] = $thisQarray[4]; $_SESSION['Q'][6] = $thisQarray[5]; $_SESSION['Q'][7] = $thisQarray[6]; $_SESSION['Q'][8] = $thisQarray[7]; $_SESSION['Q'][9] = $thisQarray[8]; I'm really at a loss and have no idea what else to try other then the above code. Thanks, R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session Array Disappears
Richard Lynch wrote: I'm thinking the guy who suggested ignore_user_abort(TRUE) is just doing Voodoo Programming :-) I love the term Voodoo Programming! I'm guilty of doing it myself. :-) My 2 cents.I could see times when ignore_user_abort(TRUE) could be very handy. I'm wondering though, if it should always be used with some sort of data check to make sure what you are about to commit to a database is not corrupted. It's been my experience that user interaction can really corrupt data. I would hate to force a script to finish if the user caused issues with the expected data. Perhaps everyone uses it in this manner in default (with data checks) and my point is moot. I just don't think ignore_user_abort(TRUE) has anything to do with my current issue since the session variables for the email portion of my script are still populated and I do receive the warning email. Thanks, R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Standard style of writing your code
Hmmm. It would be Really Nifty if some fancy IDE out there would automatically render one's PHP code in the style preferred by the developer... So no matter what was actually typed, *I* would see: function foo ($x) { //body } but some heretic who doesn't know any better would see: function foo($x) { //body } Now *THAT* would be a feature worth paying for in an IDE! :-) Gimme the code layout I want! Actually, if I remember correctly, Macromedia Flash IDE does just that. You determine what layout style you want and it complies. As for style, I personally like: function myFunction($x) // dislike "foo" { // body } In fact, I indent all blocks, but then again, I don't know any better. Been there more than once. :-) tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] shopping carts
At 1:19 PM -0500 4/24/06, Jay Blanchard wrote: [snip] Another aspect is this: Why do we call it a shopping cart? [/snip] We discarded this terminology in favor of 'order fulfillment system' or OFS Or perhaps, Shipping and Handling Internet Technology -- the acronym I leave to you. tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shopping carts
At 11:18 AM -0700 4/24/06, Ryan A wrote: > >Hey. That ain't a "shopping cart" That's a friggin' store. LOL You're absolutely right -- tho, it sounds like good stuff for a comedy routine. Pity it would fly over the heads of most people though, only us "geeks" (term used loosely) would get it Geek, a term first used to describe a circus performer who bites the heads off chickens and other such stuff. Yep, that's about right. :-) Like only Geeks would get this: tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] list noise [WAS: How to find tag and get src of image]
On Tue, 2006-04-25 at 08:45, Leonard Burton wrote: > >From pressing a few posters of RTFM answers in other projects' forums > I have found out two things: > > 1) most of them are script kiddies. > 2) most of them do not know the answer. > > They think it is more fun to post the RTFM than to not respond. And on the flip side of the coin, some of us here on the PHP list have been around so long that we've seen the same simple, it's in the FM question rehashed over and over and over AND OVER again. When someone brings it up again it just means that rather than use the manual, archives, google, their brain, their own time, they want us to do their work for them... and unlike weberdev we aren't getting paid to cater to idiots. If you carefully comb the archives you'll see that many of us that make quite liberal use of RTFM also quite often give answers to the same simple questions, and often quite recently. I don't remember who's tagline it is... but here the "teach a man to fish" pearl of wisdom applies -- even if sometimes you have to club him over the head with it. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Permission problem
Hi gang: A while back I was persuaded by this illustrious group into thinking that placing images in a file system was superior to placing them in mySQL -- after all, what could go wrong with a file system solution, right? So I did. Now, I have a small problem. Unfortunately, most of the images I've uploaded have permissions set at chmod 600 (rx- --- ---). Interesting enough, considering that all the images were all uploaded with the same script, not all of the images have the same permission problem -- that's odd. In any event, I can't back-up, download, copy, change permissions, or do anything with the chmod 600 group. Any suggestions as to what I can do with these files? Be nice... :-) Thanks. tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Permission problem
[snip] A while back I was persuaded by this illustrious group into thinking that placing images in a file system was superior to placing them in mySQL -- after all, what could go wrong with a file system solution, right? So I did. Now, I have a small problem. Unfortunately, most of the images I've uploaded have permissions set at chmod 600 (rx- --- ---). Interesting enough, considering that all the images were all uploaded with the same script, not all of the images have the same permission problem -- that's odd. In any event, I can't back-up, download, copy, change permissions, or do anything with the chmod 600 group. Any suggestions as to what I can do with these files? [/snip] After uploading have PHP CHMOD them properly -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Permission problem
On Tue, 2006-04-25 at 12:30, Jay Blanchard wrote: > [snip] > A while back I was persuaded by this illustrious group into thinking > that placing images in a file system was superior to placing them in > mySQL -- after all, what could go wrong with a file system solution, > right? > > So I did. > > Now, I have a small problem. Unfortunately, most of the images I've > uploaded have permissions set at chmod 600 (rx- --- ---). Interesting > enough, considering that all the images were all uploaded with the > same script, not all of the images have the same permission problem > -- that's odd. > > In any event, I can't back-up, download, copy, change permissions, or > do anything with the chmod 600 group. Any suggestions as to what I > can do with these files? > [/snip] > > After uploading have PHP CHMOD them properly And for your existing files create a script to load in your browser that traverses the files and CHMOD's them. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [ Way Too OT] Jokes [was: shopping carts]
> > I am anxiously awaiting the > answers!.g0g0g0g0g0!! > Me too. May be OP of Questions should tell the > answers now.. Oops sorry, had no idea there was such interest, also note that I have adopted the new subject instead of just plain old "shopping carts" as this is way OT. John Nichel got most of them, or maybe all except I heard these a bit different from him, below is how I heard them: > >> 1) Why can't you get an Elephant to screw in a > >> lightbulb? Because they wont fit in a lightbulb! > >> 2)What the difference between a herd of Elephants > and > >> a bunch af grapes? Grapes are purple elephants are gray. > >> 3)What did the peanut say to the elephant? Nothing silly! Peanuts cant talk! > >> 4)Why did the elephant fall out of the tree? He slipped > >> 5)Why did the second elephant fall out of the > tree? Because he was glued to the first one that slipped...try to keep up will you? > >> 6)Why did the third elephant fall from of the > tree? He thought it was a game! There actually is a "why did the fourth elephant fall off the tree" question but its really stupid even by elephant jokes standards (imho) so I didnt include it...but if you want it the answer is " because when his mother asked if all the elephants were falling off the trees would he too? he said yes" > >> 7)What is gray and has four legs and a trunk? A mouse going on vacation! (Haha fooled you!) Here are a few other jems: 1 - How do you stop a charging Elephant? 2- What's black and stuck between the toes of charging Elephants? 3- Why don't elephants like playing cards in the jungle? (Whh this joke is so old, mostly said near kindergarden level...) 4-Why do elephants wear sandals? 5 - Why do ostriches stick their head in the ground? 6 - How did the mouse become as big as an elephant? (Hint, think geek/computer nerd for the answer) 7 - What do you call an Elephant with a machine gun? Answers below.. 1 - Take away his credit card of course 2 - Slow pygmies 3 - Because of all the cheethas! 4 - So they wont sink in the sand 5- They are looking for the elephants that forgot to wear sandals 6- Bill gates give it a new operating system 7- Sir... Ok, there are a crapload more but will give others a chance to add theirs or let this thread die... or drop me a line for more ,have little to do today :-D Cheers! -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] list noise [WAS: How to find tag and get src of image]
On 4/25/06, Robert Cummings <[EMAIL PROTECTED]> wrote: > If you carefully comb the archives you'll see that many of us that make > quite liberal use of RTFM also quite often give answers to the same > simple questions, and often quite recently. That's a _quite_ true statement, I think :) I have been reading the list for around a year now but unfortunately I haven't really been active. I think maybe we can handle the newbie-style of threads with a protocol (a stateless one is much recommended ;) a) Write a short answer or a pointer to some page about the subject (where an answer could be found. Same applies to the PHP manual) b) Write a pointer to a How-to-ask-questions-the-smart-way-style document, gently pointing out what was wrong. RTFMs may be well deserved if the come back doing it again (which doesn't happen that often) Regards, Ahmed
Re: [PHP] cURL & cookies
On 4/25/06, Richard Lynch <[EMAIL PROTECTED]> wrote:Oh, and here's the REAL problem: > > If you use CURLOPT_HEADER, 1, then, like, for some reason beyond my > ken, the COOKIEJAR/COOOKIEFILE stuff just plain doesn't get done. > > This really sucks if you need *other* headers and want curl to manage > the Cookies for you, but there it is. > > I'm not sure if I remembered to file a bug report on that or not... > > If the general conscensus on this list is that CURLOPT_HEADER "on" > should not negate the use of CURLOPT_COOKIEFILE and/or > CURLOPT_COOKIEJAR, then we may want to file a bug report... > > But I strongly suspect that bug report would most correctly go to > curl, and not PHP, since I doubt that PHP does anything to screw this > up -- it's probably all in curl itself, no? > > Or maybe me and Peter are the only 2 guys on the planet that think you > should get to have both... > > -- > Like Music? > http://l-i-e.com/artists.htm > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Richard, On an application I was forced to write, the goal was to create an interface to another system on another server. I used cURL to grab the pages. Their system sent three cookies and used tons of redirects to set their session and validate logins. So basically I ended up with something like this: define('_COOKIEJAR', '/tmp/cjar_'. session_id()); define('_COOKIEFILE', _COOKIEJAR); curl_setopt($curl, CURLOPT_COOKIEJAR, _COOKIEJAR); curl_setopt($curl, CURLOPT_COOKIEFILE, _COOKIEJAR); curl_setopt($curl, CURLOPT_HEADER, TRUE); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE); I'm sure this is all wrong, but it was all I could come up with. ;) I have headers turned on so that I can parse them to get the header redirect history so that I can track a sort of "browser history." Curl just reported the original url even though I was three redirects away from what curl thinks it is. My point is that I have headers turned on and the cookie jar files get wrote to /tmp. So am I misunderstanding that you said it is one or the other? Let me know if I'm wrong, thanks!
Re: [PHP] PHP Standard style of writing your code
On 4/25/06, Richard Lynch <[EMAIL PROTECTED]> wrote: > Now *THAT* would be a feature worth paying for in an IDE! :-) Well, you actually don't have to pay anything. TruStudion PHP foundation version (read free/open source version) has a decent code formatter and a pretty neat editor: argument order, code completion and insight working with PHP 4 and 5 (unlike PHPEclipse), code templates, ... http://www.xored.com/trustudio Regards, Ahmed
Re: [PHP] Reusable Singleton pattern using PHP5
Jochem Maas wrote: Simas Toleikis wrote: thing :-/ Though i wonder if there are any other hacks using some sort of classkit/other class manipulation functions? probably runkit (or is it classkit - can't remember which of those is more actively developed) might give a way out - but I would recommend it for production code. I'm thinking you meant to put a 'not' somewhere in there, as in "but I would *not* recommend it for production code". -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using Header() to pass information...
Richard Lynch wrote: If you are doing your sanitization/filtering/validation correctly, you shouldn't even be READING $_POST after the first 3 lines of your PHP code anyway. (Okay, maybe first 10 lines.) The same goes for $_GET data also. The longer you use header("Location: ...") the more you realize how it's just not a substitute for a well-structured web application. Just my 2 cents. As long as we're throwing foreign money into the ring, I'd just like to say that I make a point of redirecting to another page after a post request, otherwise you get unsightly errors in the browser when the user tries to use the back/forward buttons. Other than in that situation I make sure I do includes rather than redirects. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Serveral forms in a page.
William Stokes wrote: Mulkku? 'Cause insulting us is the way to convince this list to answer your irrelevant questions? Seriously tho, if I may, go join an HTML/Javascript list for these questions and try to stick with PHP on this one. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upload Progress Meter - what's the latest?
All, I'm trying to figure out which direction the PHP community is going when it comes to an upload progress meter. I've just recently discovered the ease of installing packages using PECL and see that this package is defined: http://pecl.php.net/package/postparser Yet, there does not appear to be any code which I can install for this module. Meanwhile, I find this project here: http://pdoru.from.ro/ (upload-progress-meter-v4.1) I have install this patch and built an RPM to aid in mass deployment on our servers and it works well enough with a few minor unresolved bugs. I'm trying to avoid custom patches in PHP as I work on migrating toward clean PHP 5.1.2 and eliminate BC dependencies. Does anyone know anything about the upload progress meter development and can point me in a better direction? Dante -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpmailer problem with spam score
Merlin wrote: X-Spam: high X-Spam-score: 4.2 X-Spam-hits: BAYES_50, EXTRA_MPART_TYPE, FORGED_RCVD_HELO, HTML_MESSAGE, HTML_TAG_BALANCE_BODY, MIME_HTML_MOSTLY, SARE_OBFU_PART_ING Is there something I can do about this? These headers are coming from SpamAssassin. I suggest you look at their docs for definitions of what the X-Spam-hits mean. From my fairly limited memory I can tell you (subject to being very wrong) that... BAYES_50: Bayesian tests give it a 50% chance of being spam FORGED_RCVD_HELO: Your server did not correctly identify itself when it connected to the destination SMTP server HTML_MESSAGE: Message contains HTML HTML_TAG_BALANCE_BODY: HTML is not syntactically correct MIME_HTML_MOSTLY: The message is MIME, but there is no plain text version As I said I haven't actually looked these up, but I suggest you do. The things you need to do to prevent your messages getting high scores from spam filters are fairly simple, but they need to be researched to get it right. Hope that helps. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using Header() to pass information...
On Tue, 2006-04-25 at 13:47, Stut wrote: > Richard Lynch wrote: > > If you are doing your sanitization/filtering/validation correctly, you > > shouldn't even be READING $_POST after the first 3 lines of your PHP > > code anyway. (Okay, maybe first 10 lines.) > > The same goes for $_GET data also. > > > The longer you use header("Location: ...") the more you realize how > > it's just not a substitute for a well-structured web application. > > > > Just my 2 cents. > > As long as we're throwing foreign money into the ring, I'd just like to > say that I make a point of redirecting to another page after a post > request, otherwise you get unsightly errors in the browser when the user > tries to use the back/forward buttons. Other than in that situation I > make sure I do includes rather than redirects. Agreed. My form engine submits to the same page and uses the validation engine to check the fields, if any fails, it stays where it is and the fields will be marked and error messages about validation presented. When the user submits clean data, the form performs a redirect to the URL specified to the form engine as the action... if the action URL happens to be the same page, then it skips the redirect entirely. In my applications though, literal includes are rare within the code itself and almost exclusively only used to extend other classes since the framework performs the includes according to module/component descriptions. Almost everything is decoupled from everything else. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: phpmailer problem with spam score
Hello, on 04/25/2006 06:43 AM Merlin said the following: > Hi there, > > I am operating page where user receive a message which they do > have to confirm. The message does have about 5 links inside to give the > user administration to his postings. > > Now recently I discovered that the message does not go through to > everybody since the spam score is 4.2! This is of course not what I want > as some users are not able to confirm their postings without this e-mail. > > I am using the newest phpmailer class available and this is what the > header tells me: > > X-Spam: high > X-Spam-score: 4.2 > X-Spam-hits: BAYES_50, EXTRA_MPART_TYPE, FORGED_RCVD_HELO, HTML_MESSAGE, > HTML_TAG_BALANCE_BODY, MIME_HTML_MOSTLY, SARE_OBFU_PART_ING > > Is there something I can do about this? I don't know about phpmailer because I do not use it. I use this other MIME message composing and sending class that has evolved over the years to avoid passing the wrong sympthoms to spam filters. http://www.phpclasses.org/mimemessage I also recommend to review your HTML to assure it is validated . -- Regards, Manuel Lemos Metastorage - Data object relational mapping layer generator http://www.metastorage.net/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mccabes complexity parser
I was wondering if anyone knew of a program that I could run my scripts through and it would return mccabes complexity metric on it ... Thanks, Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Forms Validation library
Hi I just wanted to know if there's a generalised library available for Forms validation in php? -- Murtaza Chang
RE: [PHP] Permission problem
[snip] In any event, I can't back-up, download, copy, change permissions, or do anything with the chmod 600 group. Any suggestions as to what I can do with these files? [/snip] At 11:30 AM -0500 4/25/06, Jay Blanchard wrote: After uploading have PHP CHMOD them properly and At 12:41 PM -0400 4/25/06, Robert Cummings wrote: And for your existing files create a script to load in your browser that traverses the files and CHMOD's them. I hate it when you guys do that -- I don't want to think. I added a chmod to my edit.php and changed the permissions as the images were viewed -- duh! -- it couldn't be simpler. For being the bright guy I think I am, I'm pretty dim sometimes. Thanks. tedd PS: Hey, and no wisecracks about "what do you mean -- sometimes?" :-) -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upload Progress Bar (PHP/AJAX?)
Ave, I wrote a File Manager application for my company which allows the management & our clients to upload files & share files. The application has been running fine since a while now, but lately I thought about adding a Progress Bar for the file upload form. I searched a bit to find that PHP is not capable of producing an Upload Progress Bar, and I was looking into the AJAX & PHP progress bar which seems to be pretty popular. I run my Apache Web Server on a Mac OS X. Although I downloaded & configured AJAX, and also upload progress meter extension... Nothing worked... And I found out that PHP has to be patched, recompiled, reconfigured & reinstalled on a unix level (configure, make), which I really don¹t want to do at this stage as I¹m not an expert in that. I was just wondering if there is an alternate... Any other way to produce a progress bar. If someone is experienced with the AJAX/PHP Upload progress bar, and would like to contribute suggestions, I¹m open to that as well. Thanks, Rahul S. Johari Coordinator, Internet & Administration Informed Marketing Services Inc. 500 Federal Street, Suite 201 Troy NY 12180 Tel: (518) 687-6700 x154 Fax: (518) 687-6799 Email: [EMAIL PROTECTED] http://www.informed-sources.com
[PHP] Install GD2 Library - $ Reward
Hi, I have trouble with installing GD2 library correctly, someone want to take a look at it and maybe fix it? It`s a symbolic reward of 10$ to the one who solves the problem and make it work correctly :) Please send me an E-Mail at [EMAIL PROTECTED] asap. Thanks in advance, Aleksander Davidsen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Forms Validation library
Hello, on 04/25/2006 04:38 PM Murtaza Chang said the following: > Hi I just wanted to know if there's a generalised library available for > Forms validation in php? http://www.phpclasses.org/formsgeneration -- Regards, Manuel Lemos Metastorage - Data object relational mapping layer generator http://www.metastorage.net/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Install GD2 Library - $ Reward
Aleksander Davidsen wrote: Hi, I have trouble with installing GD2 library correctly, someone want to take a look at it and maybe fix it? start by supplying details on your OS, php build and everything related. It`s a symbolic reward of 10$ to the one who solves the problem and make it work correctly :) if we help you then stick the money in a charity or something. I doubt anyone here needs 10 bucks - if they do they can always sell the computer they are reading this on :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reusable Singleton pattern using PHP5
Stut wrote: Jochem Maas wrote: Simas Toleikis wrote: thing :-/ Though i wonder if there are any other hacks using some sort of classkit/other class manipulation functions? probably runkit (or is it classkit - can't remember which of those is more actively developed) might give a way out - but I would recommend it for production code. I'm thinking you meant to put a 'not' somewhere in there, as in "but I would *not* recommend it for production code". er, yes - good catch Stut! -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using Header() to pass information...
On Tue, April 25, 2006 12:47 pm, Stut wrote: > As long as we're throwing foreign money into the ring, I'd just like > to > say that I make a point of redirecting to another page after a post > request, otherwise you get unsightly errors in the browser when the > user > tries to use the back/forward buttons. Other than in that situation I > make sure I do includes rather than redirects. There are viable alternatives to breaking the back button... Not to mention that it's sometimes VERY useful to be able to use a browser that lets one re-submit a form with altered data with the back button, rather than going through the process from the beginning. Though that is application-specific. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using linkDisplayFields of FormBuilder
Hello all, I've successfully generated my DataObjects for my database and have a set of objects that extend these generated classes so that my logic is separate from the generated code (so that any slight schema changes won't overwrite my code). My question concerns using FormBuilder to change the displayfield for a linked dataobject. For example, I have table1 and table2. table1 is extended by table1extended class. I create a do from this extended class and pass that to formbuilder. table1 has a link to table2, but I'd like to make table2 use a different field when being displayed by the form generated for table1 *without having to place the fb_linkDisplayField variable into the generated do for table2*. I'd prefer to keep that out of the do. Putting it in the extendedtable2 class is alright, but how do I make formbuilder see that class instead of the base do that is generated? Even better, I'd like to be able to effect the way table2 is displayed in a form(s) generated from table1 from the page that is creating that form. (Page one with a form displays table2's name field, while page two with a form displays one of table2's other fields). This may fall more into how to structure my application. I want to separate the generated do code from my 'business logic' and separate the form/display details from the business logic. Any help/advice is greatly appreciated. Thanks, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using linkDisplayFields of FormBuilder
Tom wrote: Hello all, ..bla.. This may fall more into how to structure my application. I want to separate the generated do code from my 'business logic' and separate the form/display details from the business logic. your asking something about a specific code/tools (that I for one have not heard of before) - you might want to ask the people that wrote FormBuilder et al. Any help/advice is greatly appreciated. Thanks, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upload Progress Meter - what's the latest?
On Tue, April 25, 2006 12:18 pm, D. Dante Lorenso wrote: > I'm trying to figure out which direction the PHP community is going > when > it comes to an upload progress meter. Since that meter would necessarily be CLIENT side, the PHP community is pretty much ignoring it, since PHP runs on the SERVER. Anything you see with "PHP" "upload progress meter" together has to be some kind of hack whose under-pinning is NOT PHP at all, but is JavaScript or similar client-side technology. Why don't you ask the guys who write BROWSERS why *they* don't provide a nice API/interface to display progress, or, better yet, why the browser itself doesn't just do it once and for all for everybody? -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permission problem
On Tue, April 25, 2006 11:16 am, tedd wrote: > A while back I was persuaded by this illustrious group into thinking > that placing images in a file system was superior to placing them in > mySQL -- after all, what could go wrong with a file system solution, > right? > > So I did. > > Now, I have a small problem. Unfortunately, most of the images I've > uploaded have permissions set at chmod 600 (rx- --- ---). Interesting > enough, considering that all the images were all uploaded with the > same script, not all of the images have the same permission problem > -- that's odd. > > In any event, I can't back-up, download, copy, change permissions, or > do anything with the chmod 600 group. Any suggestions as to what I > can do with these files? You may not be able to do anything with those files logged in as 'tedd' (or whatever) but the PHP script you wrote ran as a specific user (probably 'www' or 'nobody') and THAT user can do whatever it wants to the files, because that user 'owns' them. So you can write a PHP admin script to copy or change permissions on the existing files. You'll have to surf to it for the same user to be running that script as uploaded the files. You could also ALTER your upload script for future uploads to change the http://php.net/umask before you upload files, and http://php.net/chmod the files after they are uploaded, to provide access to the 'w'orld or a 'g'roup if your webhost (or you) can put the PHP user and 'tedd' in the same group. As far as some of the files being different, those are probably files you uploaded "by hand" during testing, or your script had, at some point, calls to umask and or chmod in it, that you altered, or only called under certain circumstances. It's also possible that you changed the permissions on the containing directory at some point, which change "trickled down" to the new files created within that directory after that point in time. Once you understand how/why the Unix permissions are what they are, it's pretty trivial to figure out how to get the files to do what you want. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using Header() to pass information...
Richard Lynch wrote: On Tue, April 25, 2006 12:47 pm, Stut wrote: As long as we're throwing foreign money into the ring, I'd just like to say that I make a point of redirecting to another page after a post request, otherwise you get unsightly errors in the browser when the user tries to use the back/forward buttons. Other than in that situation I make sure I do includes rather than redirects. There are viable alternatives to breaking the back button... Not to mention that it's sometimes VERY useful to be able to use a browser that lets one re-submit a form with altered data with the back button, rather than going through the process from the beginning. Though that is application-specific. Indeed, but that's not the issue. Consider these sequences... 1) User fills in form and submits it 2) Form action script processes the form and simply outputs the page Then either... 3a) User hits back... form gets shown, hopefully (dependant on browser/cache settings) with the data the user had entered previously on it - No bad stuff here or... 3b) User clicks on a normal link, goes to another page then hits back... user sees an evil-looking and unexpected question asking whether to resubmit the form values. Most users I know will hit OK because they don't understand it. This is bad, form gets submitted again. In the case where they hit cancel instead they end up with an error message and have effectively left your site... also very bad. Better... 1) User fills in form and submits it 2) Form action script processes the form and redirects to the next page As before, either... 3a) User hits back... same thing as before happens, form is displayed hopefully with previously entered data or... 3b) User clicks on a normal link, then hits back... since the post page never ended up in the browser history this action has the same effect as in 3a, showing the form hopefully with previously entered data. If the user then submits the form again that's their choice, but in theory at least it's a better informed choice than the previous scenario. In my most humble opinion, any post handler that doesn't do a redirect after processing the form is bad. Hope that made sense. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New image already cached. (SOLVED)
On Tue, April 25, 2006 8:56 am, tedd wrote: > At 9:56 PM -0500 4/23/06, Richard Lynch wrote: >>On Sun, April 23, 2006 5:25 pm, tedd wrote: >>> >>> >>> Neither the image tag nor the file cares if there is a random >>> number >>> attached to the file's url. But, by doing this, most (perhaps all) >>> browsers think the image name is unique. >>> >>> Doe anyone see any problems with this? >> >>Oh, all the browsers will KNOW it's a unique URL... >> >>But some of them won't believe it's a valid image. :-( >> >>Alas, I do not recall which browser would mess this up -- And it's >>probably so old MOST webmasters won't care... > > I ran a test through BrowserCam and surprisingly the ONLY browser > that failed to recognize the url as a valid image was Netscape 4.78 > for W2K. But, that browser is ancient. So, it works! You may want to try it with a PDF and an FDF and a Ming SWF. The reason why I advocate the URL-embedded parameters is that I'm using the SAME code over and over for images and for PDF and for FDF and for SWF (Ming) and... If you want to maintain a different code-base for all the different browser-bugs for all the different rich media (IE, not HTML output) you're all set. If you want to maintain ONE code-base that works for all rich media, and simplify your life immensely... I've been burned by too many browser oddities over the years to use GET parameters for anything other than HTML. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Forms Validation library
Murtaza Chang wrote: Hi I just wanted to know if there's a generalised library available for Forms validation in php? -- Murtaza Chang http://pear.php.net/package/HTML_QuickForm http://ez.no/doc/components/view/latest/(file)/introduction_UserInput.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Amazon WSDL
Hey, is it possible to use the Amazon WSDL within PHP? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpmailer problem with spam score
On Tue, April 25, 2006 4:43 am, Merlin wrote: > I am operating page where user receive a message which they do > have to confirm. The message does have about 5 links inside to give > the user > administration to his postings. This has NOTHING to do with PHP... > Now recently I discovered that the message does not go through to > everybody > since the spam score is 4.2! This is of course not what I want as some > users are > not able to confirm their postings without this e-mail. Maybe that's what the users want though. It's their Inbox, after all :-) > I am using the newest phpmailer class available and this is what the > header > tells me: You should probably reference the "phpmailer class" since that could describe about 100 different software packages out there... > X-Spam: high > X-Spam-score: 4.2 > X-Spam-hits: BAYES_50 the actual text of your message looks like spam. Fix it. EXTRA_MPART_TYPE This probably means your HTML enhanced (cough, cough) mail is mal-formed. FORGED_RCVD_HELO The mailer is forging the email badly and getting caught. This may not be fixable, but you'll have to research it and experiment. HTML_MESSAGE You are sending HTML enhanced (cough, cough) email. That's your FIRST problem. All it needs is ONE link on a separate line. HTML_TAG_BALANCE_BODY, You've got more tags than content. Again, HTML enhanced (cough, cough) email is your problem. MIME_HTML_MOSTLY, Need I say it again? SARE_OBFU_PART_ING Got no idea. > Is there something I can do about this? Stop sending HTML enhanced email. Tell users to "whitelist" your domain if they are having trouble getting your email. Google for the keywords in X-Spam-Hits instead of asking the PHP mailing list why a software package which has NOTHING to do with PHP is behaving the way it is. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: phpmailer problem with spam score
On Tue, April 25, 2006 7:19 am, Merlin wrote: > Paul Scott schrieb: >> On Tue, 2006-04-25 at 11:47 +0200, Barry wrote: > Does anybody know how phpmailer sents its messages out by default? I > believe it > does this via the php function mail. But there can also be a smtp > server > specified. Do I have to set up such a server, or is it running by > default on > suse servers? If I issue a "top" command I do see smtp processes. > What would be the advantage? This has even LESS to do with PHP than your original question! Perhaps you should contact whomever wrote and supports phpmailer? If you ARE using PHP mail() function, then you may want to look into using the new optional 5th argument: http://php.net/mail You'll maybe have to patch phpmailer to use it, or get the author to patch it. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Serveral forms in a page.
On Tue, April 25, 2006 3:46 am, William Stokes wrote: > I have several forms in a page which is ok otherwise but the reset > buttons > doesn't clear anything that is queried from DB and printed to the text > fields. Any idea how to create Reset buttons that clear the fields > even when > the data is not from user input? Or do I have to create reset buttons > that > are actually submit buttons and play with variables after that or > something > like that? Javascript is the way I don't want to go... If you rule out JavaScript (the correct solution, imho) then you pretty much have correctly identified the only other option I know of: "are actually submit buttons and play with variables after that or" This will be dog-slow as it requires going back and forth from browser to web-server. To keep this on-topic, I presume that IF you could get the users to install the PHPScript plug-in that Wez Furlong wrote, you could then write client-side PHP to do what you want... Though I have no idea how stable that is, if anybody anywhere has actually installed it, nor if it actually provides the functionality I presumed it does. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Amazon WSDL
John Meyer wrote: Hey, is it possible to use the Amazon WSDL within PHP? Lookie what the first google entry for "Amazon WSDL php" was: http://www.onlamp.com/pub/a/php/2003/07/03/php_amazon_soap.html Richard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Amazon WSDL
On Tue, April 25, 2006 4:56 pm, John Meyer wrote: > Hey, is it possible to use the Amazon WSDL within PHP? http://php.net/soap should do it. If you're stuck with PHP 4, then Google nuSoap, I guess. But php 5 SOAP is about a zillion times better, imho. You type less, it just works, it's way faster, it's much cleaner... YMMV NAIAA -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Amazon WSDL
Richard Collyer wrote: John Meyer wrote: Hey, is it possible to use the Amazon WSDL within PHP? Lookie what the first google entry for "Amazon WSDL php" was: http://www.onlamp.com/pub/a/php/2003/07/03/php_amazon_soap.html why use their WDSL when 98% of the their webservices users connect using their much simpler REST interface? I read not long ago that only their very largest 'partners' (Ebay was mentioned) actually use the WDSL inteface. WDSL == OVRKLL ? ;-) Richard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Amazon WSDL
Richard Lynch wrote: On Tue, April 25, 2006 4:56 pm, John Meyer wrote: Hey, is it possible to use the Amazon WSDL within PHP? http://php.net/soap should do it. If you're stuck with PHP 4, then Google nuSoap, I guess. But php 5 SOAP is about a zillion times better, imho. You type less, it just works, it's way faster, it's much cleaner... did Richard just endorse php5? did hell freeze over? ;-> YMMV NAIAA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using Header() to pass information...
On Tue, April 25, 2006 4:47 pm, Stut wrote: > 3b) User clicks on a normal link, goes to another page then hits > back... > user sees an evil-looking and unexpected question asking whether to > resubmit the form values. Most users I know will hit OK because they > don't understand it. This is bad, form gets submitted again. It's only "bad" if your application is silly enough to accept that duplicate information twice in a row, and it shouldn't have accepted it... > In the > case > where they hit cancel instead they end up with an error message and > have > effectively left your site... also very bad. Aroo? How does cancel effectively "leave my site"? They're still ON my site. > In my most humble opinion, any post handler that doesn't do a redirect > after processing the form is bad. Hope that made sense. In my opinion, since the user CAN manage with fast-clicking, to "catch" the processing script before the redirect, and because they can STILL manage to re-submit the form, without the NORMAL browser behaviour they have come to expect, you're just BREAKING browser functionality, without actually solving the problem 100%... Guess we'll just have to agree to disagree, hunh? -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upload Progress Meter - what's the latest?
Richard Lynch wrote: On Tue, April 25, 2006 12:18 pm, D. Dante Lorenso wrote: I'm trying to figure out which direction the PHP community is going when it comes to an upload progress meter. Since that meter would necessarily be CLIENT side, the PHP community is pretty much ignoring it, since PHP runs on the SERVER. Anything you see with "PHP" "upload progress meter" together has to be some kind of hack whose under-pinning is NOT PHP at all, but is JavaScript or similar client-side technology. Why don't you ask the guys who write BROWSERS why *they* don't provide a nice API/interface to display progress, or, better yet, why the browser itself doesn't just do it once and for all for everybody? let's consider that 99% of all clients would want a 'nice' looking progress bar (in the same way they often asking me to do something about the std form fields, which they consider ugly). i.e. it would just be moving the problem somewhere else in practical terms, in so far as we'd probably still have to figure out hacks to make the bl**dy thing look nice (in the eyes of the guy/girl paying the bill ;-) and for the record there are other languages that support a progress bar idiom ... php being the pragmatic thing that it is should imho entertain this idea more seriously (waiting for browsers to implement it or ignoring the continually recurring request for such functionality) that said Richard has a very strong argument. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using linkDisplayFields of FormBuilder
On Tue, April 25, 2006 4:26 pm, Tom wrote: > I've successfully generated my DataObjects for my database and have a > ... > My question concerns using FormBuilder to change the displayfield for Of the 3000+ people on this list devoted to *GENERAL* PHP Topics, let's be generous and assume about 300 of them actually USE FormBuilder and DataObjects. Of them, maybe 30 have enough experience to actually have SOME CLUE what you are asking and why. Of that, maybe 1 is going to manage to read the message in time to do you any good. That is why you probably should have first asked this question in a forum devoted to FormBuilder and/or DataObjects, whatever those are, where ALL the readers actually care about FormBuilder and DataObjects... YMMV -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upload Progress Meter - what's the latest?
Richard Lynch wrote: On Tue, April 25, 2006 12:18 pm, D. Dante Lorenso wrote: I'm trying to figure out which direction the PHP community is going when it comes to an upload progress meter.Since that meter would necessarily be CLIENT side, the PHP community is pretty much ignoring it, since PHP runs on the SERVER. Everything PHP returns from a server is "client side", so your argument seems to indicate that we need to write all of our HTML using JavaScript also. No, the fact is that a client-side GUI does NOT exist, so we need to build it ourselves using the tools we have. I do not have source control access to Mozilla, IE, Safari, and Opera, but I can control my own PHP source. PHP receives uploads from clients and that client may not even be a web browser in all cases. From the server side, I need to be able to monitor * who is currently uploading files, * which files are being uploaded, * how big are the files being uploaded, * how much time has passed since upload began, and * what percentage of those files is completed I do not need to return this data to a client at all times. Sometimes I just want to use the data system administration, analysis, and tracking. The most popular need would be for returning the information to the client, however, as you suggest. Right now, PHP stops executing code from the time an upload begins until the time it is completed. In other languages like PERL as CGI, you can read STDIN directly in order to slurp in large POST data like file attachments. In such a case as that, solving this problem is trivial. Since PHP locks a programmer out of the loop during parsing and importing POST and GET variables, we need PHP code to break into that loop and return callback functions or update internal data structures directly. Part of the problem in addition to collection of the data is being able to share it with other PHP instances. Remember that PHP runs in Apache in most cases and does not have shared memory between PHP instances. Therefore, writing the upload data to an external data storage is necessary. That external storage could be Sqlite, PostgreSQL, MySQL, files, or even Memcache. I would love to see a memcache-like solution. But more importantly, I would like to see a solution which is adopted by the community rather than miserably hacked together then not supported and abandoned. Anything you see with "PHP" "upload progress meter" together has to be some kind of hack whose under-pinning is NOT PHP at all, but is JavaScript or similar client-side technology. Not true. The graphical display is HTML, DHTML, JavaScript, etc...but the means of monitoring the progress from the server side MUST be done with PHP. The code that I have seen so far requires hooks into PHP which execute callback functions periodically in order to update the progress of uploaded files as PHP processes input. Why don't you ask the guys who write BROWSERS why *they* don't provide a nice API/interface to display progress, or, better yet, why the browser itself doesn't just do it once and for all for everybody? That is a good idea, and I will recommend it for future solutions. For short term, that is not the focus of this email. Dante -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cURL & cookies
On Tue, April 25, 2006 11:50 am, Eric Butera wrote: > On 4/25/06, Richard Lynch <[EMAIL PROTECTED]> wrote:Oh, and here's the > REAL > problem: > >> >> If you use CURLOPT_HEADER, 1, then, like, for some reason beyond my >> ken, the COOKIEJAR/COOOKIEFILE stuff just plain doesn't get done. > On an application I was forced to write, the goal was to create an > interface > to another system on another server. I used cURL to grab the pages. > Their > system sent three cookies and used tons of redirects to set their > session > and validate logins. So basically I ended up with something like > this: > > define('_COOKIEJAR', '/tmp/cjar_'. session_id()); > define('_COOKIEFILE', _COOKIEJAR); > > curl_setopt($curl, CURLOPT_COOKIEJAR, _COOKIEJAR); > curl_setopt($curl, CURLOPT_COOKIEFILE, _COOKIEJAR); > curl_setopt($curl, CURLOPT_HEADER, TRUE); > curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE); > My point is that I have headers turned on and the cookie jar files get > wrote > to /tmp. So am I misunderstanding that you said it is one or the > other? > > Let me know if I'm wrong, thanks! Sounds to me like we have different versions of cURL and yours is better. :-) Mine phpinfo() curl section has: libcurl/7.15.3 OpenSSL/0.9.7d zlib/1.2.1 which would seem to be the most current version... Or, perhaps, the order in which you set the options matters? Ick. For me, at least, the Cookie jar did not work until I took out the CURLOPT_HEADER, and it DID work after I changed that, and only that. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using linkDisplayFields of FormBuilder
I've mailed this list per the instructions on the pear.php.net site. I first thought to email the lead maintainer (Justin Patrin) for the DB_DataObject_FormBuilder package (http://pear.php.net/package/DB_DataObject_FormBuilder) but the email form page gave these instructions: "Do not send email to this developer if you are in need of support for any of his/her package(s), instead we recommend emailing [EMAIL PROTECTED] where you are more likely to get answer. You can subscribe to the pear-general mailinglist from the Support - Mailinglist page." That's what I've done. Also, searching the list archive turned up some questions from users and answers from the package's lead maintainer (http://beeblex.com/lists/index.php/php.pear.general/20823?s=formbuilder+%3Aphp.pear.general), so I thought this was appropriate, on top of respecting the explicit instructions of the site, Justin Patrin's inbox and the idea that submitting to the mailinglist will allow others to see questions/solutions and contribute/benefit. Other than contacting the developer directly (which, again, seems to be discouraged), and search engines, (google didn't turn up anything specific to this concern), does anyone have other specific resources regarding FormBuilder? Tom Richard Lynch wrote: On Tue, April 25, 2006 4:26 pm, Tom wrote: I've successfully generated my DataObjects for my database and have a ... My question concerns using FormBuilder to change the displayfield for Of the 3000+ people on this list devoted to *GENERAL* PHP Topics, let's be generous and assume about 300 of them actually USE FormBuilder and DataObjects. Of them, maybe 30 have enough experience to actually have SOME CLUE what you are asking and why. Of that, maybe 1 is going to manage to read the message in time to do you any good. That is why you probably should have first asked this question in a forum devoted to FormBuilder and/or DataObjects, whatever those are, where ALL the readers actually care about FormBuilder and DataObjects... YMMV -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [W O T] mccabes complexity parser
Mark Steudel wrote: I was wondering if anyone knew of a program that I could run my scripts through and it would return mccabes complexity metric on it ... not that I know of (actually didn't know the term until I read your post :-) but I bet Windows Vista scores well above 50 ;-) Thanks, Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using linkDisplayFields of FormBuilder
Thomas Supercinski wrote: Jochem, I've mailed this list per the instructions on the pear.php.net site. I first thought to email the lead maintainer for the DB_DataObject_FormBuilder package (http://pear.php.net/package/DB_DataObject_FormBuilder) you should have given that link in the first place, it helps to put your question in context. your obviously didn't start php'ing yesterday if your using DB_DataObject_FormBuilder :-) maybe someone here uses it also and can give some tips - I can't claim to have ever used it so I can't be of any assistance on this matter, I guess it's wait and see if anyone else can. but the email form page gave these instructions: "Do not send email to this developer if you are in need of support for any of his/her package(s), instead we recommend emailing [EMAIL PROTECTED] where you are more likely to get answer. [EMAIL PROTECTED] != php-general@lists.php.net (then again may it does, in which case my apologies) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upload Progress Meter - what's the latest?
On Tue, April 25, 2006 5:28 pm, D. Dante Lorenso wrote: > Richard Lynch wrote: >> On Tue, April 25, 2006 12:18 pm, D. Dante Lorenso wrote: >> Anything you see with "PHP" "upload progress meter" together has to >> be >> some kind of hack whose under-pinning is NOT PHP at all, but is >> JavaScript or similar client-side technology. >> > > Not true. The graphical display is HTML, DHTML, JavaScript, etc...but > the means of monitoring the progress from the server side MUST be done > with PHP. I'm sorry. Your original post sounded (to me) like you wanted a progress meter on the browser (client-side) for the user to see their files uploaded. AFAIK, all the tools you referenced were written with that purpose in mind. Presumably even the worst browsers have some concept of how large the file is, and how many bytes have been sent to the server. So you certainly DO NOT need server-side information to implement a client-side progress meter of the progress of a file upload! > The code that I have seen so far requires hooks into PHP > which execute callback functions periodically in order to update the > progress of uploaded files as PHP processes input. Yes, which is a silly place to try and "fix" this for client-side progress meters, as you then generate traffic back-and-forth from the client to measure the number of bytes received, instead of the browser just measuring bytes sent. > browser in all cases. From the server side, I need to be able to > monitor > > * who is currently uploading files, > * which files are being uploaded, > * how big are the files being uploaded, > * how much time has passed since upload began, and > * what percentage of those files is completed > > I do not need to return this data to a client at all times. Sometimes > I > just want to use the data system administration, analysis, and > tracking. The most popular need would be for returning the > information > to the client, however, as you suggest. In this case, a "meter" isn't going to cut it... You'd need a battery of meters, for all running processes, or at least all the ones currently in file upload state. You'd also need tie-ins to your login/authentication to determin "who is uploading files" as the only answer inherent to PHP is "the User set in httpd.conf" Which files are being uploaded would presumably display both the original name as sent by the browser, which is not something one can trust for anything useful, and the /tmp name. How big they are relies on the browser sending the correct Content-length: for the upload. I don't know how often they get it right, but I'm betting that are some pretty common errors in this area that PHP corrects for already. So your meters would not be accurate in some (hopefully few) cases. While I can see where this might be a useful tool to have server-side, I can suggest several possible ways to implement some portions of it without hacking PHP source. First, it's a pretty safe bet that PHP uses a common prefix on the files being uploaded. So you could write a tool to watch /tmp for files and get a list of the /tmp names being uploaded. That would at least tell you how many files are currently in upload status. Using filectime and filemtime would tell you the timing info -- Though Windows will suck (as usual) as it only tracks to the nearest minute or something... For tying the filenames back to the users who are logged in, you'd have to have an onClick() on the submit button which would send some kind of information (filename, filesize, user) to a PHP script that would log the upload about to begin in a database. The onClick would then return false so that the normal form submission process would kick in. You would then have to use heuristics about the file timing to "guess" which files were most likely which -- though you could probably get pretty accurate about that part, especially if you are willing to code it so that completed uploads tie back in and eliminate incorrect guesses. You're not going to get the level of accuracy you'd have with hacked PHP source, but you can get enough accuracy for statistical analysis. It won't be so hot for tracking who's uploading what in real-time, due to the guessing part -- but after the upload finishes your information will be as accurate as it can be with hacked source. Another option is to provide patch to PHP which gives a special INPUT parameter to a FORM that can be used to provide a callback file to load, and a callback function within that file to call, and then modify the file upload routine to load and call that function. It seems genuinely useful enough to this naive reader, and should not cause an undue burden for those who don't use it. Check with PHP-Dev to see if such a patch is likely to be accepted before putting in TOO much time on it. HTH >> Why don't you ask the guys who write BROWSERS why *they* don't >> provide >> a nice API/interface to display progress, or, better yet, why the
Re: [PHP] Upload Progress Meter - what's the latest?
On Tue, April 25, 2006 5:28 pm, D. Dante Lorenso wrote: > Everything PHP returns from a server is "client side", so your Oh yeah. I forgot to say... The above presumption is patently false. :-) -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upload Progress Meter - what's the latest?
On Tue, April 25, 2006 5:27 pm, Jochem Maas wrote: > Richard Lynch wrote: >> On Tue, April 25, 2006 12:18 pm, D. Dante Lorenso wrote: >> Why don't you ask the guys who write BROWSERS why *they* don't >> provide >> a nice API/interface to display progress, or, better yet, why the >> browser itself doesn't just do it once and for all for everybody? > > let's consider that 99% of all clients would want a 'nice' looking > progress bar (in the same way they often asking me to do something > about the std form fields, which they consider ugly). > > i.e. it would just be moving the problem somewhere else in practical > terms, in so far as we'd probably still have to figure out hacks to > make > the bl**dy thing look nice (in the eyes of the guy/girl paying the > bill ;-) Well, yes, if the browser doesn't provide "hooks" for the look n feel of the darn thing, we're not solving anything. I still don't think a progress meter for browsers is something that belongs in PHP in any way, shape, or form. Please note my other much longer post on useful server-side statistical info about file uploads, however. There *IS* a progress meter on some browsers down in the status bar, or in other places, which, apparently, the average user is too clueless to notice consciously. Though I have noted that semi-experienced users "know" it is there subconsciously if you ask them the right questions about how far along the upload is. Very weird animal, those users... :-) -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] need help to put input text value into url
I have a form like this: while this is working fine, I would like the url of search.php to be something like search.php?q="value+of+search_text" eg, if I enter "php rules" in my text box, the url should be http://myfakepage.com/search.php?q="php+rules"; any idea how to do that? thanx in advance Pat -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] need help to put input text value into url
Only chage method="post" for method="get" Regards! -Mensaje original- De: Patrick Aljord [mailto:[EMAIL PROTECTED] Enviado el: Martes, 25 de Abril de 2006 06:19 p.m. Para: php-general@lists.php.net Asunto: [PHP] need help to put input text value into url I have a form like this: while this is working fine, I would like the url of search.php to be something like search.php?q="value+of+search_text" eg, if I enter "php rules" in my text box, the url should be http://myfakepage.com/search.php?q="php+rules"; any idea how to do that? thanx in advance Pat -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Upload Progress Meter - what's the latest?
[snip] ...a pretty good discussion... [/snip] I have used output buffering to flush stuff (like lengthy data) to the client before the end of the script so that those pesky users could see something was happening (because they couldn't be bothered to watch the browser's progress meter) and at one time thought that you might be able to do something like a progress meter with that. Since the http process is stateless it would be hard to provide a truly accurate progress meter. There are too many factors at play. Using PHP in an Ajax environment might move it a little closer and is an interesting thought and depends upon the reliability of the asynchronous request. There is the old stand-by...send an animated gif to the browser with no real timing involved. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Amazon WSDL
Richard Collyer wrote: > John Meyer wrote: >> Hey, is it possible to use the Amazon WSDL within PHP? >> > > Lookie what the first google entry for "Amazon WSDL php" was: > > http://www.onlamp.com/pub/a/php/2003/07/03/php_amazon_soap.html > > Richard Nice, now I need to navigate the bloody Amazon web services. Is it just me, or does it look like, just by browsing Amazon itself, you have to use Alexis to do web queries. Specifically, I'm trying to find out how to query using an ISDN. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upload Progress Meter - what's the latest?
Richard Lynch wrote: On Tue, April 25, 2006 5:28 pm, D. Dante Lorenso wrote: Everything PHP returns from a server is "client side", so your Oh yeah. I forgot to say... The above presumption is patently false. Let me clarify: Assuming client/server architecture, if PHP is on the server side then something else needs to be on the client side to interpret the output of the PHP server. That output is what PHP returns and it is interpreted and rendered on the client side by definition. Alternatively: If it is not meant for the client to receive, it is not (should not) be output by PHP. Dante -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP/LDAP Setup Problem
I need to add LDAP support to my install of PHP. I had my sysadmin download OpenLDAP and install the libraries. Our current build of PHP is complex and I'd prefer not to have to rebuild just to add LDAP. I've been told to use the dl() function to load the LDAP library when needed in PHP. Whenever I dl("libldap.so") PHP returns the following error: PHP Warning: dl(): Invalid library (maybe not a PHP library) 'libldap.so' in . What am I doing wrong? Thanks in advance. Jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upload Progress Meter - what's the latest?
Richard Lynch wrote: Anything you see with "PHP" "upload progress meter" together has to be some kind of hack whose under-pinning is NOT PHP at all, but is JavaScript or similar client-side technology. Not true. The graphical display is HTML, DHTML, JavaScript, etc...but the means of monitoring the progress from the server side MUST be done with PHP. I'm sorry. Your original post sounded (to me) like you wanted a progress meter on the browser (client-side) for the user to see their files uploaded. Yes, I want that also. Really, I want the feature to exist in the PHP language regardless of how I intend to use it. That's the beauty of a programming language vs a program. I want the tools to be able to build what I want however I might want it at the time. Presumably even the worst browsers have some concept of how large the file is, and how many bytes have been sent to the server. So you certainly DO NOT need server-side information to implement a client-side progress meter of the progress of a file upload! Agreed. I SHOULD not NEED this feature. Other server-side languages exist, so I technically don't NEED PHP either. I don't really want to debate whether this feature should exist or not, but it seems to me that the replies I've gotten from this list so far suggest that internals of PHP development are seriously opposed to such a feature? I am more interested in which project extensions are leading in momentum to solve the problem I am trying to solve and not blaming other projects (browsers) for not building the feature first. The code that I have seen so far requires hooks into PHP which execute callback functions periodically in order to update the progress of uploaded files as PHP processes input. Yes, which is a silly place to try and "fix" this for client-side progress meters, as you then generate traffic back-and-forth from the client to measure the number of bytes received, instead of the browser just measuring bytes sent. The back-and-forth you refer to is termed 'polling'. With a protocol like HTTP, polling is really the only option unless I implement a socket server which is capable of sending events. This is something I may be building into the project also, but aside from HOW I move the server-side collect data back to a web client, that is independent of needing to collect the information on the server side in a format which can be accessed and read easily. browser in all cases. From the server side, I need to be able to monitor * who is currently uploading files, * which files are being uploaded, * how big are the files being uploaded, * how much time has passed since upload began, and * what percentage of those files is completed I do not need to return this data to a client at all times. Sometimes I just want to use the data system administration, analysis, and tracking. The most popular need would be for returning the information to the client, however, as you suggest. You'd need a battery of meters, for all running processes, or at least all the ones currently in file upload state. I would like to have a list of all file uploads in progress, yes. A semi-frequently updated snapshot of the information I defined would be sufficient. If a callback function is invoked periodically it would be equivalent to firing an event and would allow a php program to log the data to a common data repository which could be ready by another process on the system. You'd also need tie-ins to your login/authentication to determin "who is uploading files" as the only answer inherent to PHP is "the User set in httpd.conf" Right. Under the callback method example, I would have access to $_SESSION which would already contain enough information about the logged in account for my purposes. This is trivial. How big they are relies on the browser sending the correct Content-length: for the upload. I don't know how often they get it right, but I'm betting that are some pretty common errors in this area that PHP corrects for already. So your meters would not be accurate in some (hopefully few) cases. The POST method sets the Content-length, right. So, PHP must trust that the browsers are not lying. For security purposes we don't need to worry about whether this number is wrong because it is only for display. Processing uploaded files does not occur until the file completes uploading. While I can see where this might be a useful tool to have server-side, I can suggest several possible ways to implement some portions of it without hacking PHP source. First, ... you could write a tool to watch /tmp for files and get a list of the /tmp names being uploaded. Yes, this is simple. Using filectime and filemtime would tell you the timing info -- Though Windows will suck (as usual) as it only tracks to the nearest minute or something... Yes. Using Linux. This will work. For
Re: [PHP] Re: phpmailer problem with spam score
Richard Lynch wrote: On Tue, April 25, 2006 7:19 am, Merlin wrote: Paul Scott schrieb: On Tue, 2006-04-25 at 11:47 +0200, Barry wrote: Does anybody know how phpmailer sents its messages out by default? I believe it does this via the php function mail. But there can also be a smtp server specified. Do I have to set up such a server, or is it running by default on suse servers? If I issue a "top" command I do see smtp processes. What would be the advantage? This has even LESS to do with PHP than your original question! since when does that matter here :-P Perhaps you should contact whomever wrote and supports phpmailer? I'm pretty sure he read this list - and given the fact that nearly everyone has used it I think it fair game for generals... besides the basic mechanism/interface (forgetting the nitty gritty details of mail headers etc that phpmailer takes care of underwater) is very simple. phpmailer is a lovely little [collection of] classes - no outside dependencies - does what it says on the tin, no fuss; I like it :-) If you ARE using PHP mail() function, then you may want to look into using the new optional 5th argument: http://php.net/mail You'll maybe have to patch phpmailer to use it, or get the author to patch it. it supports mail() - it's the default send mechanism -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpmailer problem with spam score
Stut wrote: Merlin wrote: X-Spam: high X-Spam-score: 4.2 X-Spam-hits: BAYES_50, EXTRA_MPART_TYPE, FORGED_RCVD_HELO, HTML_MESSAGE, HTML_TAG_BALANCE_BODY, MIME_HTML_MOSTLY, SARE_OBFU_PART_ING Is there something I can do about this? [snip] As of Spamassassin version 3.1.X it is BAYES_50: Bayesian tests give it a 50% chance of being spam Bayesian spam probability is 40 to 60% and score is 0.0001 which is very low to consider in your case. FORGED_RCVD_HELO: Your server did not correctly identify itself when it connected to the destination SMTP server score is 0.13 HTML_MESSAGE: Message contains HTML score is 0.0001, again to low to consider. HTML_TAG_BALANCE_BODY: HTML is not syntactically correct MIME_HTML_MOSTLY: The message is MIME, but there is no plain text version look for this one. score ranging from 0.6 to 2.3. EXTRA_MPART_TYPE: Header has extraneous Content-type:...type= score ranging from 0.73 to 1.09. SARE_OBFU_PART_ING: This rule seem to be custom.. What Stut said is correct but I would suggest you try out your mail with default spam scores set by Spamassassin. Mail server administrators can specify whatever scores they want for any tests. So you can't possibly maintain ham status of your mail on every server (running spamassassin) your mail sent to. All this considering your mail really isn't spam.. :-). -- Sameer N. Ingole Blog: http://weblogic.noroot.org/ --- Better to light one candle than to curse the darkness. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Removing special chars
I would like to replace all chars in a string that are not a-z or 0-9 with a space. I can use a series of str_replace functions, but there has to be a faster way. I know there is a solution but my chemo-brain is slowing me down today. Sorry... Any suggestions? TIA Gerry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Removing special chars
I would like to replace all chars in a string that are not a-z or 0-9 with a space. I can use a series of str_replace functions, but there has to be a faster way. I know there is a solution but my chemo-brain is slowing me down today. Sorry... Any suggestions? TIA Gerry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Removing special chars
Gerry Danen wrote: I would like to replace all chars in a string that are not a-z or 0-9 with a space. I can use a series of str_replace functions, but there has to be a faster way. I know there is a solution but my chemo-brain is slowing me down today. Sorry... Any suggestions? TIA Gerry Not sure which would be easier or faster - but str_replace can take an array (black list approach) , or use preg_replace so you can do a white list approach. -- life is a game... so have fun. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Protecting index.php
Initial index.php file: = Hackers seem to be able to call a remote script by appending the URL to the href= command line . ( $include ) What buttons do I need to push to stop this? Does PHP have a setting to allow only local calls? or do I have to do it in the index.php file ? or ?? Advice welcome! -Pete -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php